*/
/** Path to CDB */
const char *cdbPath = "raw://";
-
+Bool_t cholm = false;
/**
* Interface (pure virtual) that all configuration classes must
* implement.
/** @return Forward mult task (PWGLF) */
virtual Bool_t UsePWGLFForward() const = 0;
/* @} */
+ /**
+ * Print one flag
+ *
+ * @param title Title
+ * @param use Use or not
+ */
+ virtual void PrintOne(const char* title, Bool_t use) const
+ {
+ Printf("%-30s : %3s", title, use ? "yes" : "no");
+ }
+ /**
+ * Print settings
+ *
+ */
+ virtual void Print() const {
+ PrintOne("Connect to CDB", UseCDBconnect());
+ PrintOne("Use physics selection", UsePhysicsSelection());
+ PrintOne("Use tender wagon", UseTender());
+ PrintOne("Use centrality", UseCentrality());
+ PrintOne("Use V0 correction in tender", UseV0tender());
+ PrintOne("Activate debugging", UseDBG());
+ PrintOne("Use MC info", UseMC());
+ PrintOne("Use Kinematics filter", UseKFILTER());
+ PrintOne("Use track references", UseTR());
+ PrintOne("Use correction framework", UseCORRFW());
+ PrintOne("Use AOD tags", UseAODTAGS());
+ PrintOne("Use sys info", UseSysInfo());
+ PrintOne("Produces an AOD or dAOD's", UseAODhandler());
+ PrintOne("ESD to AOD filter", UseESDfilter());
+ PrintOne("Use Muon train ", UsePWGMuonTrain());
+ PrintOne("Copy muon events", UseMUONcopyAOD());
+ PrintOne("Jet analysis (PWG4)", UseJETAN());
+ PrintOne("Jet delta AODs", UseJETANdelta());
+ PrintOne("Vertexing HF task (PWG3)", UsePWGHFvertexing());
+ PrintOne("JPSI filtering (PWG3)", UsePWGDQJPSIfilter());
+ PrintOne("D0->2 hadrons (PWG3)", UsePWGHFd2h());
+ PrintOne("PID response", UsePIDResponse());
+ PrintOne("Forward mult task (PWGLF)", UsePWGLFForward());
+ }
};
VirtualAODCfg* aodCfg = 0;
// CDBconnect
if ((aodCfg->UseCDBconnect() && !aodCfg->UseTender())
&& !LoadLibrary("PWGPP")) return false;
- if ((aodCfg->UseESDfilter() || aodCfg->UsePWGMuonTrain())
- && !LoadLibrary("PWGmuon")) return kFALSE;
+ if ((aodCfg->UseESDfilter() ||
+ (aodCfg->UsePWGMuonTrain() && detCfg->UseMUON())))
+ if (!LoadLibrary("PWGmuon")) return kFALSE;
// JETAN
- if ((aodCfg->UseJETAN() || aodCfg->UseJETANdelta())
- && !LoadLibrary("JETAN")) return kFALSE;
+ if ((aodCfg->UseJETAN() || aodCfg->UseJETANdelta()))
+ if (!LoadLibrary("JETAN")) return kFALSE;
if (aodCfg->UseJETANdelta()) { // CINT doesn't like long '||' chains
if (!LoadLibrary("CGAL")) return false;
if (!LoadLibrary("fastjet")) return false;
}
// PWG3 Vertexing HF
- if ((aodCfg->UsePWGHFvertexing() || aodCfg->UsePWGHFd2h())) {
+ if (aodCfg->UsePWGHFvertexing() || aodCfg->UsePWGHFd2h())) {
// CINT doesn't like long '||' chains
if (!LoadLibrary("PWGflowBase")) return false;
if (!LoadLibrary("PWGflowTasks")) return false;
- // if (!LoadLibrary("PWGTRD")) return false;
+ if (cholm) if (!LoadLibrary("PWGTRD")) return false;
if (!LoadLibrary("PWGHFvertexingHF")) return false;
}
}
// --- PWGLF - Forward (cholm@nbi.dk) -----------------------------
- if (aodCfg->UsePWGLFForward() && aodCfg->UsePhysicsSelection()) {
+ if (aodCfg->UsePWGLFForward() &&
+ aodCfg->UsePhysicsSelection() &&
+ detCfg->UseFMD()) {
gROOT->LoadMacro(pwglf+"/FORWARD/analysis2/AddTaskForwardMult.C");
// Arguments are
// mc Assume MC input
// config Configuration script
// corrdir Possible directory containing custom OADB corrections
// HACK load custom corrections
- Info("", "Adding forward AOD task with mc=%d",aodCfg->UseMC() && aodCfg->UseTR());
+ Info("", "Adding forward AOD task with mc=%d",
+ aodCfg->UseMC() && aodCfg->UseTR());
AddTaskForwardMult(aodCfg->UseMC() && aodCfg->UseTR(),0,0,0,0,
"ForwardAODConfig.C",".");
gROOT->LoadMacro(pwglf+"/FORWARD/analysis2/AddTaskCentralMult.C");
if (aodCfg->UseESDfilter()) {
// ESD filter task configuration.
gROOT->LoadMacro(ana+"/ESDfilter/macros/AddTaskESDFilter.C");
- if (aodCfg->UseMUONcopyAOD()) {
+ if (aodCfg->UseMUONcopyAOD() && detCfg->UseMUON()) {
printf("Registering delta AOD file\n");
mgr->RegisterExtraFile("AliAOD.Muons.root");
mgr->RegisterExtraFile("AliAOD.Dimuons.root");
}
// --- PWG3 D2h ----------------------------------------------------
- if (aodCfg->UsePWGHFd2h()) {
+ if (aodCfg->UsePWGHFd2h() && aodCfg->UsePWGHFvertexing()) {
gROOT->LoadMacro(pwghf+"/vertexingHF/AddD2HTrain.C");
TFile::Cp(gSystem->ExpandPathName(configPWGHFd2h.Data()),
"file:ConfigVertexingHF.C");
outputFiles.Add(new TObjString("AliAOD.root,"));
if (aodCfg->UsePWGHFvertexing())
outputFiles.Add(new TObjString("AliAOD.VertexingHF.root,"));
- if (aodCfg->UseESDfilter() && aodCfg->UseMUONcopyAOD())
+ if (aodCfg->UseESDfilter() &&
+ aodCfg->UseMUONcopyAOD() &&
+ detCfg->UseMUON())
outputFiles.Add(new TObjString("AliAOD.Muons.root,"));
if (aodCfg->UseJETAN())
outputFiles.Add(new TObjString("AliAOD.Jets.root,"));
outputFiles.Add(new TObjString("AliAOD.Dielectron.root,"));
outputFiles.Add(new TObjString("pyxsec_hists.root"));
TString mergeExcludes = "";
- TIter iter(outputFiles);
+ TIter iter(&outputFiles);
TObjString* str = 0;
Bool_t merged = kTRUE;
while ((str = static_cast<TObjString*>(iter()))) {
*/
void AOD(UInt_t run, const char* xmlfile=0, Int_t stage=0)
{
+ TString host(gSystem->HostName());
+ cholm = host.BeginsWith("hehi");
+ if (cholm) TGrid::Connect("alien:");
+
// -----------------------------------------------------------------
//
// Get GRP parameters. Defines global "grp" as a pointer to GRPData
//
gROOT->Macro(Form("GRP.C(%d)", run));
gROOT->Macro("AODConfig.C");
+ gROOT->Macro("DetConfig.C");
// --- Some settings -----------------------------------------------
// Set temporary merging directory to current one
printf("=========== RUNNING FILTERING TRAIN ==========\n");
printf("===================================================\n");
printf("= Configuring analysis train for:\n");
- if (aodCfg->UsePhysicsSelection()) printf("= Physics selection");
- if (aodCfg->UseTender()) printf("= TENDER");
- if (aodCfg->UseESDfilter()) printf("= ESD filter");
- if (aodCfg->UseMUONcopyAOD()) printf("= MUON copy AOD");
- if (aodCfg->UseJETAN()) printf("= Jet analysis");
- if (aodCfg->UseJETANdelta()) printf("= Jet delta AODs");
- if (aodCfg->UsePWGHFvertexing()) printf("= PWGHF vertexing");
- if (aodCfg->UsePWGDQJPSIfilter()) printf("= PWGDQ j/psi filter");
- if (aodCfg->UsePWGHFd2h()) printf("= PWGHF D0->2 hadrons QA");
+ aodCfg->Print();
// Load common libraries and set include path
if (!LoadCommonLibraries()) {
/** @return ESD to AOD filter (barrel + muon tracks) */
virtual Bool_t UseESDfilter() const { return true; }
/** @return Use Muon train */
- virtual Bool_t UsePWGMuonTrain() const { return true; }
+ virtual Bool_t UsePWGMuonTrain() const { return false; }
/** @return Task that copies only muon events */
- virtual Bool_t UseMUONcopyAOD() const { return true; }
+ virtual Bool_t UseMUONcopyAOD() const { return false; }
/** @return Jet analysis (PWG4) */
virtual Bool_t UseJETAN() const { return false; }
/** @return Jet delta AODs */
virtual Bool_t UseJETANdelta() const { return false; }
/** @return Vertexing HF task (PWG3) */
- virtual Bool_t UsePWGHFvertexing() const { return true; }
+ virtual Bool_t UsePWGHFvertexing() const { return false; }
/** @return JPSI filtering (PWG3) */
virtual Bool_t UsePWGDQJPSIfilter() const { return false; }
/** @return D0->2 hadrons (PWG3) */
- virtual Bool_t UsePWGHFd2h() const { return true; }
+ virtual Bool_t UsePWGHFd2h() const { return false; }
/** @return PID response */
- virtual Bool_t UsePIDResponse() const { return true; }
+ virtual Bool_t UsePIDResponse() const { return false; }
/** @return Forward mult task (PWGLF) */
virtual Bool_t UsePWGLFForward() const { return true; }
/* @} */
#include "AliPID.h"
#endif
-TH1F* CreateHisto(const char* name, const char* title,
- Int_t nBins, Double_t xMin, Double_t xMax,
- const char* xLabel = NULL, const char* yLabel = NULL)
+//____________________________________________________________________
+/**
+ * Create a histogram
+ *
+ * @param name Name of histogram
+ * @param title Title of histogram
+ * @param nBins Number of bins
+ * @param xMin Lease X valuee
+ * @param xMax Largest X value
+ * @param xLabel X label
+ * @param yLabel Y label
+ *
+ * @return newly allocated histogram
+ */
+TH1*
+CreateHisto(const char* name,
+ const char* title,
+ Int_t nBins,
+ Double_t xMin,
+ Double_t xMax,
+ const char* xLabel = NULL,
+ const char* yLabel = NULL)
{
-// create a histogram
-
+ // create a histogram
TH1F* result = new TH1F(name, title, nBins, xMin, xMax);
result->SetOption("E");
if (xLabel) result->GetXaxis()->SetTitle(xLabel);
return result;
}
-TH1F* CreateEffHisto(TH1F* hGen, TH1F* hRec)
+//____________________________________________________________________
+/**
+ * Create efficiency histogram
+ *
+ * @param hGen Generated
+ * @param hRec Reconstructed
+ *
+ * @return Newly allocated histogram
+ */
+TH1* CreateEffHisto(TH1* hGen, TH1* hRec)
{
-// create an efficiency histogram
-
+ // create an efficiency histogram
+
Int_t nBins = hGen->GetNbinsX();
- TH1F* hEff = (TH1F*) hGen->Clone("hEff");
+ TH1* hEff = static_cast<TH1*>(hGen->Clone("hEff"));
hEff->SetTitle("");
hEff->SetStats(kFALSE);
hEff->SetMinimum(0.);
return hEff;
}
-Bool_t FitHisto(TH1* histo, Double_t& res, Double_t& resError)
+//____________________________________________________________________
+/**
+ * Fit a Gaussian distribution to data in histogram
+ *
+ * @param histo Histogram to fit
+ * @param res On return, the result
+ * @param resError On return, the error on the result
+ *
+ * @return true on success, false if too few entries
+ */
+Bool_t
+FitHisto(TH1* histo, Double_t& res, Double_t& resError)
{
-// fit a gaussian to a histogram
-
static TF1* fitFunc = new TF1("fitFunc", "gaus");
fitFunc->SetLineWidth(2);
fitFunc->SetFillStyle(0);
Double_t maxFitRange = 2;
- if (histo->Integral() > 50) {
- Float_t mean = histo->GetMean();
- Float_t rms = histo->GetRMS();
- fitFunc->SetRange(mean - maxFitRange*rms, mean + maxFitRange*rms);
- fitFunc->SetParameters(mean, rms);
- histo->Fit(fitFunc, "QRI0");
- histo->GetFunction("fitFunc")->ResetBit(1<<9);
- res = TMath::Abs(fitFunc->GetParameter(2));
- resError = TMath::Abs(fitFunc->GetParError(2));
- return kTRUE;
- }
-
- return kFALSE;
+ if (histo->Integral() <= 50) return false;
+
+ Float_t mean = histo->GetMean();
+ Float_t rms = histo->GetRMS();
+ fitFunc->SetRange(mean - maxFitRange*rms, mean + maxFitRange*rms);
+ fitFunc->SetParameters(mean, rms);
+ histo->Fit(fitFunc, "QRI0");
+ histo->GetFunction("fitFunc")->ResetBit(1<<9);
+ res = TMath::Abs(fitFunc->GetParameter(2));
+ resError = TMath::Abs(fitFunc->GetParError(2));
+ return true;
}
-
+//====================================================================
+/**
+ * Run the check.
+ *
+ * @param gAliceFileName MC steering file
+ * @param esdFileName Reconstructed data
+ *
+ * @return true on success
+ */
Bool_t Check(const char* gAliceFileName = "galice.root",
const char* esdFileName = "AliESDs.root")
{
-// check the content of the ESD
+ // check the content of the ESD
// check values
Int_t checkNGenLow = 1;
Info("CheckESD", "check of ESD was successfull");
return kTRUE;
}
+//
+// EOF
+//
}
};
-
-
-
-
void Config()
{
// --- Get settings from environment variables --------------------
// --- Go back to galice.root --------------------------------------
rl->CdGAFile();
- // --- Switch on and off detectors ---------------------------------
- Int_t iABSO = 1;
- Int_t iACORDE= 0;
- Int_t iDIPO = 1;
- Int_t iEMCAL = 1;
- Int_t iFMD = 1;
- Int_t iFRAME = 1;
- Int_t iHALL = 1;
- Int_t iITS = 1;
- Int_t iMAG = 1;
- Int_t iMUON = 1;
- Int_t iPHOS = 1;
- Int_t iPIPE = 1;
- Int_t iPMD = 1;
- Int_t iHMPID = 1;
- Int_t iSHIL = 1;
- Int_t iT0 = 1;
- Int_t iTOF = 1;
- Int_t iTPC = 1;
- Int_t iTRD = 1;
- Int_t iVZERO = 1;
- Int_t iZDC = 1;
-
-
//=================== Alice BODY parameters =============================
AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
- if (iMAG) new AliMAG("MAG", "Magnet");
- if (iABSO) new AliABSOv3("ABSO", "Muon Absorber");
- if (iDIPO) new AliDIPOv3("DIPO", "Dipole version 3");
- if (iHALL) new AliHALLv3("HALL", "Alice Hall");
- if (iFRAME) (new AliFRAMEv2("FRAME", "Space Frame"))->SetHoles(1);
- if (iSHIL) new AliSHILv3("SHIL", "Shielding Version 3");
- if (iPIPE) new AliPIPEv3("PIPE", "Beam Pipe");
- if (iITS) new AliITSv11("ITS","ITS v11");
- // if (iITS) new AliITSv11Hybrid("ITS","ITS v11Hybrid");
- if (iTPC) new AliTPCv2("TPC", "Default");
- if (iTOF) new AliTOFv6T0("TOF", "normal TOF");
- if (iHMPID) new AliHMPIDv3("HMPID", "normal HMPID");
- if (iZDC) {
+ if (detCfg->UseMAG()) new AliMAG("MAG", "Magnet");
+ if (detCfg->UseABSO()) new AliABSOv3("ABSO", "Muon Absorber");
+ if (detCfg->UseDIPO()) new AliDIPOv3("DIPO", "Dipole version 3");
+ if (detCfg->UseHALL()) new AliHALLv3("HALL", "Alice Hall");
+ if (detCfg->UseFRAME()) (new AliFRAMEv2("FRAME", "Space Frame"))->SetHoles(1);
+ if (detCfg->UseSHIL()) new AliSHILv3("SHIL", "Shielding Version 3");
+ if (detCfg->UsePIPE()) new AliPIPEv3("PIPE", "Beam Pipe");
+ if (detCfg->UseITS()) new AliITSv11("ITS","ITS v11");
+ // if (detCfg->UseITS()) new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+ if (detCfg->UseTPC()) new AliTPCv2("TPC", "Default");
+ if (detCfg->UseTOF()) new AliTOFv6T0("TOF", "normal TOF");
+ if (detCfg->UseHMPID()) new AliHMPIDv3("HMPID", "normal HMPID");
+ if (detCfg->UseZDC()) {
AliZDC *ZDC = 0;
if (grp->period.EqualTo("LHC10h")) {
// Need to use older ZDC for PbPb
ZDC->SetBeamEnergy(82.*grp->beamEnergy/208.);
}
}
- if (iTRD) {
+ if (detCfg->UseTRD()) {
AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
AliTRDgeometry *geoTRD = TRD->GetGeometry();
// Total of 18 super modules. We turn them all off by default
geoTRD->SetSMstatus(13,1);
}
}
- if (iFMD) new AliFMDv1("FMD", "normal FMD");
- if (iMUON) {
+ if (detCfg->UseFMD()) new AliFMDv1("FMD", "normal FMD");
+ if (detCfg->UseMUON()) {
AliMUON *MUON = new AliMUONv1("MUON", "default");
MUON->SetTriggerEffCells(1); // not needed if raw masks
MUON->SetTriggerResponseV1(2);
}
- if (iPHOS) new AliPHOSv1("PHOS", "noCPV_Modules123");
- if (iPMD) new AliPMDv1("PMD", "normal PMD");
- if (iT0) new AliT0v1("T0", "T0 Detector");
- if (iEMCAL) new AliEMCALv2("EMCAL", "EMCAL_COMPLETE12SMV1");
- if (iACORDE) new AliACORDEv1("ACORDE", "normal ACORDE");
- if (iVZERO) new AliVZEROv7("VZERO", "normal VZERO");
+ if (detCfg->UsePHOS()) new AliPHOSv1("PHOS", "noCPV_Modules123");
+ if (detCfg->UsePMD()) new AliPMDv1("PMD", "normal PMD");
+ if (detCfg->UseT0()) new AliT0v1("T0", "T0 Detector");
+ if (detCfg->UseEMCAL()) new AliEMCALv2("EMCAL", "EMCAL_COMPLETE12SMV1");
+ if (detCfg->UseACORDE()) new AliACORDEv1("ACORDE", "normal ACORDE");
+ if (detCfg->UseVZERO()) new AliVZEROv7("VZERO", "normal VZERO");
}
--- /dev/null
+/**
+ * Base class for detector configuration. By default, everything is on
+ * except ACORDE.
+ */
+struct VirtualDetCfg
+{
+ virtual Bool_t UseABSO() const { return true; }
+ virtual Bool_t UseACORDE() const { return false; }
+ virtual Bool_t UseDIPO() const { return true; }
+ virtual Bool_t UseEMCAL() const { return true; }
+ virtual Bool_t UseFMD() const { return true; }
+ virtual Bool_t UseFRAME() const { return true; }
+ virtual Bool_t UseHALL() const { return true; }
+ virtual Bool_t UseITS() const { return true; }
+ virtual Bool_t UseMAG() const { return true; }
+ virtual Bool_t UseMUON() const { return true; }
+ virtual Bool_t UsePHOS() const { return true; }
+ virtual Bool_t UsePIPE() const { return true; }
+ virtual Bool_t UsePMD() const { return true; }
+ virtual Bool_t UseHMPID() const { return true; }
+ virtual Bool_t UseSHIL() const { return true; }
+ virtual Bool_t UseT0() const { return true; }
+ virtual Bool_t UseTOF() const { return true; }
+ virtual Bool_t UseTPC() const { return true; }
+ virtual Bool_t UseTRD() const { return true; }
+ virtual Bool_t UseVZERO() const { return true; }
+ virtual Bool_t UseZDC() const { return true; }
+ virtual void Print()
+ {
+ Printf("ABSO: %3s", UseABSO() ? "yes" : "no");
+ Printf("ACORDE: %3s", UseACORDE() ? "yes" : "no");
+ Printf("DIPO: %3s", UseDIPO() ? "yes" : "no");
+ Printf("EMCAL: %3s", UseEMCAL() ? "yes" : "no");
+ Printf("FMD: %3s", UseFMD() ? "yes" : "no");
+ Printf("FRAME: %3s", UseFRAME() ? "yes" : "no");
+ Printf("HALL: %3s", UseHALL() ? "yes" : "no");
+ Printf("ITS: %3s", UseITS() ? "yes" : "no");
+ Printf("MAG: %3s", UseMAG() ? "yes" : "no");
+ Printf("MUON: %3s", UseMUON() ? "yes" : "no");
+ Printf("PHOS: %3s", UsePHOS() ? "yes" : "no");
+ Printf("PIPE: %3s", UsePIPE() ? "yes" : "no");
+ Printf("PMD: %3s", UsePMD() ? "yes" : "no");
+ Printf("HMPID: %3s", UseHMPID() ? "yes" : "no");
+ Printf("SHIL: %3s", UseSHIL() ? "yes" : "no");
+ Printf("T0: %3s", UseT0() ? "yes" : "no");
+ Printf("TOF: %3s", UseTOF() ? "yes" : "no");
+ Printf("TPC: %3s", UseTPC() ? "yes" : "no");
+ Printf("TRD: %3s", UseTRD() ? "yes" : "no");
+ Printf("VZERO: %3s", UseVZERO() ? "yes" : "no");
+ Printf("ZDC: %3s", UseZDC() ? "yes" : "no");
+ }
+ /**
+ * Get the string of enabled detectors for local reconstruction.
+ *
+ * @param enable On return, contains string of enable detectors
+ */
+ void GetRecoString(TString& enable) const
+ {
+ if (UseITS()) Append2Str(enable, "ITS");
+ if (UseTPC()) Append2Str(enable, "TPC");
+ if (UseTRD()) Append2Str(enable, "TRD");
+ if (UseTOF()) Append2Str(enable, "TOF");
+ if (UsePHOS()) Append2Str(enable, "PHOS");
+ if (UseHMPID()) Append2Str(enable, "HMPID");
+ if (UseEMCAL()) Append2Str(enable, "EMCAL");
+ if (UseMUON()) Append2Str(enable, "MUON");
+ if (UseFMD()) Append2Str(enable, "FMD");
+ if (UseZDC()) Append2Str(enable, "ZDC");
+ if (UsePMD()) Append2Str(enable, "PMD");
+ if (UseT0()) Append2Str(enable, "T0");
+ if (UseVZERO()) Append2Str(enable, "VZERO");
+ }
+ /**
+ * Get the string of detectors for which we should make Summable
+ * Digits
+ *
+ * @param sDigits On returm contains the string of enable detectors
+ */
+ void GetSDigitString(TString& sDigits) const
+ {
+ if (UseTRD()) Append2Str(sDigits, "TRD");
+ if (UseTOF()) Append2Str(sDigits, "TOF");
+ if (UsePHOS()) Append2Str(sDigits, "PHOS");
+ if (UseHMPID()) Append2Str(sDigits, "HMPID");
+ if (UseEMCAL()) Append2Str(sDigits, "EMCAL");
+ if (UseMUON()) Append2Str(sDigits, "MUON");
+ if (UseFMD()) Append2Str(sDigits, "FMD");
+ if (UseZDC()) Append2Str(sDigits, "ZDC");
+ if (UsePMD()) Append2Str(sDigits, "PMD");
+ if (UseT0()) Append2Str(sDigits, "T0");
+ if (UseVZERO()) Append2Str(sDigits, "VZERO");
+ }
+ /**
+ * Get the sting of detectors for which we should do the hit to
+ * digit conversion directly.
+ *
+ * @param fromHits On returm contains the string of enable detectors
+ */
+ void GetHits2DigitsString(TString& fromHits) const
+ {
+ if (UseITS()) Append2Str(fromHits, "ITS");
+ if (UseTPC()) Append2Str(fromHits, "TPC");
+ }
+ /**
+ * Append a C style string to a string, possibly adding a space before
+ *
+ * @param str Where to append
+ * @param append What to append
+ */
+ static void Append2Str(TString& str, const char* append)
+ {
+ if (!str.IsNull()) str.Append(" ");
+ str.Append(append);
+ }
+
+};
+/** Global variable */
+VirtualDetCfg* detCfg = 0;
+
+/**
+ * Particular set-up of detectors to use. By default everything but
+ * ACORDE is on. Here, we turn off a few other detectors.
+ */
+struct DetCfg : public VirtualDetCfg
+{
+ // virtual Bool_t UseEMCAL() const { return false; }
+ // virtual Bool_t UseMUON() const { return false; }
+ // virtual Bool_t UsePHOS() const { return false; }
+ // virtual Bool_t UseHMPID() const { return false; }
+ // virtual Bool_t UseTOF() const { return false; }
+ // virtual Bool_t UseTRD() const { return false; }
+};
+
+/**
+ * Create the detector configuration
+ *
+ * @return Pointer to global @c detCfg
+ */
+void DetConfig()
+{
+ Info("DetConfig", "Creating detector configuration");
+ detCfg = new DetCfg;
+ detCfg->Print();
+}
+//
+// EOF
+//
+
InputFile = {
"LF:@data@/$4.C",
"LF:@data@/$4Config.C",
+ "LF:@data@/DetConfig.C",
"LF:@data@/GRP.C",
"LF:@data@/fmd_corrections.root",
"LF:@out@/$3/$1/$4_Stage_$2.xml"
OutputDir = "@out@/$3/$1";
OutputArchive = {
"$4_merge_log_archive.zip:std*,fileinfo*.log@disk=1",
- "$4_merge_archive.zip:*.root,*.stat*@disk=2"
+ "$4_merge_archive.zip:*$4*.root,*.stat*@disk=2"
};
TTL = "36000";
Price = "1";
InputFile={
"LF:@data@/$4.C",
"LF:@data@/$4Config.C",
+ "LF:@data@/DetConfig.C",
"LF:@data@/GRP.C",
"LF:@data@/fmd_corrections.root"
--- /dev/null
+struct VirtualOCDBCfg
+{
+ /**
+ * This member function must return the default prefix.
+ *
+ * @return Prefix of OCDB specific storages
+ */
+ virtual const char* Prefix() const { return ""; }
+ /**
+ * This member function should define the real setup.
+ *
+ * @param forSim Whether we're setting up for simulations or not
+ */
+ virtual void Init(Bool_t forSim)
+ {
+ ::Fatal("VirtualOCDBConfig", "Dummy init called - redefine!");
+ }
+ /**
+ * Set the specific storage for a given key (possibly wild-carded).
+ *
+ * @param key Key
+ * @param ideal Whether it is residual or ideal
+ */
+ void AddStore(const char* key,
+ Bool_t ideal)
+ {
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ const char* prefix = Prefix();
+ TString path = Form("alien://Folder=/alice/simulation/%s/%s",
+ prefix, !ideal ? "Residual" : "Ideal");
+ ::Info("AddStore", "%s -> %s", key, path.Data());
+ cdb->SetSpecificStorage(key, path);
+ }
+};
+VirtualOCDBCfg* ocdbCfg = 0;
+
+/**
+ * Specific implementation. Note, this requires that GRP.C has been
+ * loaded and exectuted before calling Init.
+ */
+struct OCDBCfg : public VirtualOCDBCfg
+{
+ const char* Prefix() const { return "2008/v4-15-Release"; }
+ void Init(Bool_t forSim)
+ {
+ Bool_t is10h = grp->period.EqualTo("LHC10h");
+
+ // --- ITS (1 Total) ----------------------------------------------
+ AddStore("ITS/Align/Data", forSim);
+ if (!forSim)
+ AddStore("ITS/Align/SPDSparseDead",false);
+
+ // --- MUON (1 object) ---------------------------------------------
+ AddStore("MUON/Align/Data", forSim);
+
+ // ---- TPC (6 total) ----------------------------------------------
+ AddStore("TPC/Calib/TimeGain", forSim);
+ AddStore("TPC/Calib/ClusterParam", forSim);
+ AddStore("TPC/Calib/AltroConfig", forSim);
+ AddStore("TPC/Calib/Correction", forSim);
+ AddStore("TPC/Align/Data", forSim);
+ AddStore("TPC/Calib/TimeDrift", forSim);
+ AddStore("TPC/Calib/RecoParam", (forSim && !is10h));
+
+ // --- ZDC for 2010 the following is needed ------------------------
+ // (https://savannah.cern.ch/task/?func=detailitem&item_id=33180#comment46)
+ if (is10h) AddStore("ZDC/Align/Data",true);
+ }
+};
+
+
+void OCDBConfig()
+{
+ ::Info("OCDBConfig", "Creating OCDB configuration");
+ ocdbCfg = new OCDBCfg;
+}
+
+
+
--- /dev/null
+TVirtualPad* MakeCanvas(const char* title="")
+{
+ static Int_t cId = 0;
+ TCanvas* c = new TCanvas(Form("c%02d", ++cId), title);
+ c->SetTopMargin(0.02);
+ c->SetRightMargin(0.02);
+ c->cd();
+ return c;
+}
+
+Double_t SumUsage(TTree* tree,
+ const char* exp,
+ const char* cut,
+ bool draw=false)
+{
+ //
+ // return sum of usage
+ //
+ if (draw) MakeCanvas(Form("%s [%s]", exp, cut));
+
+ Int_t entries = tree->Draw(exp, cut, (draw ? "" : "goff"));
+ if (entries==0) return 0;
+
+ Double_t mean = TMath::Mean(entries, tree->GetV1());
+ return entries * mean;
+}
+Double_t TopUsage(TTree* tree,
+ const char* exp,
+ const char* cut,
+ Int_t order)
+{
+ Int_t entries = tree->Draw(exp, cut, "goff");
+ if (entries <= 1 || !tree->GetV1()) return -10000;
+
+ TArrayI index(entries);
+ TMath::Sort(entries, tree->GetV1(), index.fArray);
+
+ Int_t oindex = TMath::Min(order, entries);
+ Double_t value = tree->GetV1()[index[oindex-1]];
+
+ return value;
+}
+
+TH1* ExtractHist(TTree* tree,
+ const char* exp,
+ const char* cut,
+ const char* name,
+ const char* xtitle="",
+ const char* ytitle="",
+ Bool_t draw=false)
+{
+ tree->Draw(Form("%s>>tmpa", exp), cut, "GOFF");
+ if (!tree->GetHistogram()) return 0;
+
+ TH1* ret = static_cast<TH1*>(tree->GetHistogram()->Clone(name));
+ delete tree->GetHistogram();
+ ret->SetXTitle(xtitle);
+ ret->SetYTitle(ytitle);
+ ret->SetMarkerStyle(22);
+ ret->SetMarkerSize(1);
+ if (draw) {
+ if (draw) MakeCanvas(name);
+ ret->Draw();
+ }
+ return ret;
+}
+
+
+void Print(std::ostream& o,
+ const char* name,
+ Double_t dT,
+ Double_t dVM,
+ Double_t alldT,
+ Double_t alldVM)
+{
+ o << name << "\t"
+ << dT << "\t"
+ << dVM << "\t"
+ << 100*(alldT > 0 ? dT / alldT : 0) << "\t"
+ << 100*(alldVM > 0 ? dVM / alldVM : 0) << std::endl;
+}
+
+const char* dets[] = {"ITS",
+ "TPC",
+ "TRD",
+ "TOF",
+ "PHOS",
+ "HMPID",
+ "EMCAL",
+ "MUON",
+ "FMD",
+ "ZDC",
+ "PMD",
+ "T0",
+ "VZERO",
+ "ACORDE",
+ "HLT",
+ 0 };
+
+
+void
+Plot1SysInfo(const char* file, UShort_t draw=0x1)
+{
+ // gROOT->LoadMacro("$ALICE_ROOT/../master-src/macros/PlotSys.C+");
+
+ // --- Create output file and tree ---------------------------------
+ TString rootOut(file);
+ rootOut.ReplaceAll(".log", ".root");
+ rootOut.ReplaceAll(".foo", ".root");
+ Info("", "Writing to ROOT file %s", rootOut.Data());
+ TFile* out = TFile::Open(rootOut, "RECREATE");
+ TTree* tree = AliSysInfo::MakeTree(file);
+
+
+
+ // --- Create ASCII output ------------------------------------------
+ TString sumOut(rootOut);
+ sumOut.ReplaceAll(".root", ".sum");
+ Info("", "Writing to ASCII file %s", sumOut.Data());
+ std::ofstream ascii(sumOut.Data());
+ ascii << "Det/C:sumDt/F:sumDvm/F:fracDt/F:fracDvm/F" << std::endl;
+
+ // --- Get global stuff ---------------------------------------------
+ const char* all = "id0>=0&&id2>=0";
+ Double_t sumdTAll = SumUsage(tree, "deltaT", all, draw & 0x1);
+ Double_t sumdVMAll = SumUsage(tree, "deltaVM", all, draw & 0x1);
+ Double_t topdT = TopUsage(tree, "deltaT", "id2<3", 20);
+ Double_t topdVM = TopUsage(tree, "deltaVM", "", 20);
+ TCut cutT("cutDT", Form("deltaT > %f", topdT));
+ TCut cutVM("cutVM", Form("deltaVM > %f", topdVM));
+
+ ExtractHist(tree, "deltaVM:sname", "1"+cutVM,
+ "DVMvsName","","#DeltaVM [MB]", draw&0x4);
+ ExtractHist(tree, "VM:sname", "id2<3"+cutVM,
+ "VMvsName", "", "VM [MB]", draw&0x4);
+ ExtractHist(tree, "VM:T", "deltaVM>1",
+ "VMvsTime", "Time [sec]", "VM [MB]", draw&0x4);
+ ExtractHist(tree, "deltaT:sname","id2<3"+cutT,
+ "CPUvsName","","#DeltaT [sec]", draw&0x4);
+
+
+
+ Print(ascii, "all", sumdTAll, sumdVMAll, sumdTAll, sumdVMAll);
+
+
+
+ // --- Loop over detetors ------------------------------------------
+ const char** pdet = dets;
+ Int_t idet = 0;
+ while (*pdet) {
+ TString cut = Form("id0==%d && id2 >= 0", idet);
+ Double_t sumdT = SumUsage(tree, "deltaT", cut, draw & 0x2);
+ Double_t sumdVM = SumUsage(tree, "deltaVM", cut, draw & 0x2);
+ Print(ascii, *pdet, sumdT, sumdVM, sumdTAll, sumdVMAll);
+
+#if 0
+ TString cut2 = Form("id0==%d",idet);
+ ExtractHist(tree, "deltaVM:sname", cut2.Data()+cutVM,
+ Form("DVMvsName_%02d", idet), "", "#DeltaVM [MB]", draw&0x8);
+ ExtractHist(tree, "VM:sname", cut2.Data()+cutVM,
+ Form("VMvsName_%02d", idet), "", "VM [MB]", draw&0x8);
+ ExtractHist(tree, "deltaT:sname", cut2.Data()+cutT,
+ Form("CPUvsName_%02d", idet),"", "#DeltaT [sec]", draw&0x8);
+#endif
+
+ pdet++;
+ idet++;
+ }
+ ascii.close();
+
+ new TBrowser;
+}
+
+
+
+PlotSysInfo(ULong_t pid=431808952)
+{
+ Plot1SysInfo(Form("%d_simwatch.log", pid));
+ Plot1SysInfo(Form("%d_recowatch.log", pid));
+}
+
+
virtual Bool_t DoV0() const = 0;
/** @return Get Debug level */
virtual Int_t DebugLevel() const = 0;
+
+ virtual void PrintOne(const char* title, Bool_t use) const
+ {
+ Printf("%-30s : %3s", title, use ? "yes" : "no");
+ }
+ virtual void Print() const
+ {
+ PrintOne("CDBconnect ", DoCDBconnect());
+ PrintOne("EventStat ", DoEventStat());
+ PrintOne("Centrality ", DoCentrality());
+ PrintOne("QAsym ", DoQAsym());
+ PrintOne("VZERO", DoVZERO());
+ PrintOne("VZEROPbPb ", DoVZEROPbPb());
+ PrintOne("Vertex ", DoVertex());
+ PrintOne("SPD needs RP ", DoSPD());
+ PrintOne("TPC ", DoTPC());
+ PrintOne("HLT ", DoHLT());
+ PrintOne("SDD needs RP", DoSDD());
+ PrintOne("SSDdEdx ", DoSSDdEdx());
+ PrintOne("TRD ", DoTRD());
+ PrintOne("ITS ", DoITS());
+ PrintOne("ITSsaTracks ", DoITSsaTracks());
+ PrintOne("ITSalign ", DoITSalign());
+ PrintOne("CALO ", DoCALO());
+ PrintOne("MUONTrig ", DoMUONTrig());
+ PrintOne("ImpParRes ", DoImpParRes());
+ PrintOne("MUON ", DoMUON());
+ PrintOne("TOF ", DoTOF());
+ PrintOne("HMPID ", DoHMPID());
+ PrintOne("T0 ", DoT0());
+ PrintOne("ZDC ", DoZDC());
+ PrintOne("PIDResponse ", DoPIDResponse());
+ PrintOne("PIDqa ", DoPIDqa());
+ PrintOne("FWD ", DoFWD());
+ PrintOne("PHOS ", DoPHOS());
+ PrintOne("PHOSTrig ", DoPHOSTrig());
+ PrintOne("EMCAL ", DoEMCAL());
+ PrintOne("FBFqa ", DoFBFqa());
+ PrintOne("MUONEff NEEDS geometry", DoMUONEff());
+ PrintOne("V0 NEEDS MCtruth ", DoV0());
+ }
};
VirtualQACfg* qaCfg = 0;
gSystem->Load("libPWGPP.so");
gSystem->Load("libAliHLTTrigger.so");
- if (qaCfg->DoEMCAL() || qaCfg->DoPHOS() ||
+ if ((qaCfg->DoEMCAL() && detCfg->UseEMCAL()) ||
+ ((qaCfg->DoPHOS() || qaCfg->DoPHOSTrig()) && detCfg->UsePHOS()) ||
(qaCfg->DoCALO() && !is10h)) {
gSystem->Load("libEMCALUtils");
gSystem->Load("libPHOSUtils");
gSystem->Load("libPWGEMCAL");
gSystem->Load("libPWGGAEMCALTasks");
}
- if(qaCfg->DoMUON() || qaCfg->DoMUONTrig()) {
+ if((qaCfg->DoMUON() || qaCfg->DoMUONTrig()) && detCfg->UseMUON()) {
gSystem->Load("libPWGmuon");
gSystem->Load("libPWGPPMUONlite");
gSystem->Load("libPWGmuondep");
}
- if (qaCfg->DoFWD()) {
+ if (qaCfg->DoFWD() && detCfg->UseFMD()) {
gSystem->Load("libPWGLFforward2");
}
}
kTriggerMuonBarell);
}
// --- VZERO QA (C. Cheshkov) -------------------------------------
- if (qaCfg->DoVZERO()) {
+ if (qaCfg->DoVZERO() && detCfg->UseVZERO()) {
gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskVZEROQA.C");
AliAnalysisTaskSE * taskv0qa = AddTaskVZEROQA(0);
}
- if (qaCfg->DoVZEROPbPb() && grp->IsAA()) {
+ if (qaCfg->DoVZEROPbPb() && detCfg->UseVZERO() && grp->IsAA()) {
gROOT->LoadMacro(pwgpp+"/VZERO/AddTaskVZEROPbPb.C");
AliAnaVZEROPbPb* taskV0PbPb =
(AliAnaVZEROPbPb*)AddTaskVZEROPbPb(Int_t(grp->run));
// the 2st argument to false
// - Optionally highMult axis can be used by setting the 3st
// argument to true (for PbPb)
- if (qaCfg->DoTPC()) {
+ if (qaCfg->DoTPC() && detCfg->UseTPC()) {
gROOT->LoadMacro(pwgpp+"/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
AliPerformanceTask *tpcQA = 0;
if (grp->IsAA()) {
}
// --- HLT (Alberica Toia) -----------------------------------------
- if (qaCfg->DoHLT()) {
+ if (qaCfg->DoHLT() && detCfg->UseTPC()) {
gROOT->LoadMacro(pwgpp+"/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
- AliPerformanceTask *hltQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kFALSE,0,kTRUE);
+ AliPerformanceTask *hltQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE,
+ kFALSE,0,kTRUE);
hltQA->SelectCollisionCandidates(kTriggerMask);
}
// --- SPD (A. Mastroserio) ----------------------------------------
- if (qaCfg->DoSPD()) {
+ if (qaCfg->DoSPD() && detCfg->UseITS()) {
gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskSPDQA.C");
AliAnalysisTaskSPD* taskspdqa = (AliAnalysisTaskSPD*)AddTaskSPDQA();
// Request from Annalisa
taskspdqa->SetOCDBInfo(grp->run, "raw://");
}
// --- SDD (F. Prino) ----------------------------------------------
- if (qaCfg->DoSDD()) {
+ if (qaCfg->DoSDD() && detCfg->UseITS()) {
gROOT->LoadMacro(pwgpp+"/PilotTrain/AddSDDPoints.C");
AliAnalysisTaskSE* tasksdd = AddSDDPoints();
tasksdd->SelectCollisionCandidates(kTriggerMask);
}
// --- SSD dEdx (Marek Chojnacki) ----------------------------------
- if (qaCfg->DoSSDdEdx()) {
+ if (qaCfg->DoSSDdEdx() && detCfg->UseITS()) {
gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskdEdxSSDQA.C");
AliAnalysisTaskSE* taskssddedx = AddTaskdEdxSSDQA();
taskssddedx->SelectCollisionCandidates(kTriggerMask);
}
// --- ITS ---------------------------------------------------------
- if (qaCfg->DoITS()) {
+ if (qaCfg->DoITS() && detCfg->UseITS()) {
// hardcoded non-zero trigger mask
gROOT->LoadMacro(pwgpp+"/macros/AddTaskPerformanceITS.C");
AliAnalysisTaskITSTrackingCheck *itsQA = 0;
}
}
// --- ITS saTracks, align (F.Prino) -------------------------------
- if (qaCfg->DoITSsaTracks()) {
+ if (qaCfg->DoITSsaTracks() && detCfg->UseITS()) {
// offline trigger in AddTask
gROOT->LoadMacro(pwgpp+"/macros/AddTaskITSsaTracks.C");
AliAnalysisTaskITSsaTracks *itssaTracks = AddTaskITSsaTracks(kTRUE,kFALSE);
itssaTracks->SelectCollisionCandidates(kTriggerMask);
}
- if (qaCfg->DoITSalign()) {
+ if (qaCfg->DoITSalign() && detCfg->UseITS()) {
// no offline trigger selection
gROOT->LoadMacro(pwgpp+"/macros/AddTaskITSAlign.C");
AliAnalysisTaskITSAlignQA *itsAlign = AddTaskITSAlign(0,2011);
}
// --- TRD (Alex Bercuci, M. Fasel) --------------------------------
- if(qaCfg->DoTRD()) {
+ if(qaCfg->DoTRD() && detCfg->UseTRD()) {
// no offline trigger selection
gROOT->LoadMacro(pwgpp+"/macros/AddTrainPerformanceTRD.C");
// steer individual TRD tasks
}
// --- ZDC (Chiara Oppedisano) -------------------------------------
- if(qaCfg->DoZDC()) {
+ if(qaCfg->DoZDC() && detCfg->UseZDC()) {
// hardcoded kMB trigger mask
gROOT->LoadMacro(pwgpp+"/ZDC/AddTaskZDCQA.C");
AliAnalysisTaskSE *taskZDC = AddTaskZDCQA();
}
// --- Muon Trigger ------------------------------------------------
- if(qaCfg->DoMUONTrig()) {
+ if(qaCfg->DoMUONTrig() && detCfg->UseMUON()) {
// no offline trigger selection
gROOT->LoadMacro(pwgpp+"/macros/AddTaskMTRchamberEfficiency.C");
AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency();
}
// --- Muon Efficiency (not used) ----------------------------------
- if(qaCfg->DoMUONEff()) {
+ if(qaCfg->DoMUONEff() && detCfg->UseMUON()) {
gROOT->LoadMacro(ali+"/PWG3/muondep/AddTaskMUONTrackingEfficiency.C");
AliAnalysisTaskMuonTrackingEff *taskMuonTrackEff =
AddTaskMUONTrackingEfficiency();
}
// --- MUON QA (Philippe Pillot) -----------------------------------
- if (qaCfg->DoMUON()) {
+ if (qaCfg->DoMUON() && detCfg->UseMUON()) {
// trigger analysis internal
gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskMuonQA.C");
AliAnalysisTaskSE* taskmuonqa= AddTaskMuonQA();
}
// --- TOF (Francesca Bellini) -------------------------------------
- if (qaCfg->DoTOF()) {
+ if (qaCfg->DoTOF() && detCfg->UseTOF()) {
gROOT->LoadMacro(pwgpp+"/TOF/AddTaskTOFQA.C");
AliAnalysisTaskTOFqa *tofQA = AddTaskTOFQA(kFALSE);
tofQA->SelectCollisionCandidates(kTriggerMask);
// --- HMPID QA (Giacomo Volpe) ------------------------------------
//
- if (qaCfg->DoHMPID()) {
+ if (qaCfg->DoHMPID() && detCfg->UseHMPID()) {
gROOT->LoadMacro(pwgpp+"/HMPID/AddTaskHmpidQA.C");
AliAnalysisTaskSE* taskhmpidqa= AddTaskHmpidQA(kTRUE);
// offline mask set in AddTask to kMB
}
// --- T0 QA (Alla Mayevskaya) -------------------------------------
- if (qaCfg->DoT0()) {
+ if (qaCfg->DoT0() && detCfg->UseT0()) {
// no offline trigger selection
gROOT->LoadMacro(pwgpp+"/T0/AddTaskT0QA.C");
AliT0AnalysisTaskQA* taskt0qa= AddTaskT0QA();
}
// ---- FMD QA (Christian Holm Christiansen) -----------------------
- if (qaCfg->DoFWD()) {
+ if (qaCfg->DoFWD() && detCfg->UseFMD()) {
gROOT->LoadMacro(pwglf+"/FORWARD/analysis2/AddTaskForwardQA.C");
// Parameters: usemc, usecentrality
// AliAnalysisTaskSE *forwardQA = (AliAnalysisTaskSE *)
}
// --- PHOS QA (Boris Polishchuk) ----------------------------------
- if (qaCfg->DoPHOS()) {
+ if (qaCfg->DoPHOS()&& detCfg->UsePHOS()) {
gROOT->LoadMacro(pwgga+"/PHOSTasks/CaloCellQA/macros/AddTaskCaloCellsQA.C");
AliAnalysisTaskCaloCellsQA *taskPHOSCellQA1 =
AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_AnyInt");
AliAnalysisTaskPHOSPbPbQA* phosPbPb = AddTaskPHOSPbPbQA(0);
}
}
- if (qaCfg->DoPHOSTrig()) {
+ if (qaCfg->DoPHOSTrig() && detCfg->UsePHOS()) {
gROOT->LoadMacro(pwgga+
"/PHOSTasks/PHOS_TriggerQA/macros/AddTaskPHOSTriggerQA.C");
AliAnalysisTaskPHOSTriggerQA *taskPHOSTrig = AddTaskPHOSTriggerQA(0,0);
}
// --- EMCAL QA (Gustavo Conesa) -----------------------------------
- if (qaCfg->DoEMCAL()) {
+ if (qaCfg->DoEMCAL() && detCfg->UseEMCAL()) {
gROOT->LoadMacro(pwgga+"/EMCALTasks/macros/AddTaskEMCALTriggerQA.C");
AliAnalysisTaskEMCALTriggerQA *emctrig = AddTaskEMCALTriggerQA();
}
//
gROOT->Macro(Form("GRP.C(%d)", run));
gROOT->Macro("QAConfig.C");
+ gROOT->Macro("DetConfig.C");
+ qaCfg->Print();
Int_t debug_level = qaCfg->DebugLevel(); // Debugging
TString cdbString(cdb);
if (cdbString.Contains("raw://")) {
that all steering scripts must load `GRP.C`, and hence we can at no
point use any of previously used scripts.
+## Setting up a simulation
+
+The idea of these scripts are that we only change things in one
+well-defined place, and that the scripts react to JDL parameters so
+that we can re-use the scripts (and settings) for many kinds of
+simulation passes.
+
+### Configuring which detectors to include
+
+Create a class called `DetCfg` deriving from `VirtualDetCfg` and
+have it return true/false for the detectors you want to have on/off.
+The class _must_ be declared in `DetConfig.C` and the function
+`DetConfig()` _must_ set the global object pointer `detCfg` to point
+to a new instance of the class `DetCfg`.
+
+The script `DetConfig.C` is executed by both `Simulate.C` and
+`Reconstruct.C` to get the list of enabled detectors. The script is
+also executed by `AOD.C` and `QA.C` to ensure that we do not add tasks
+for which we have no data because the needed detectors was turned
+off.
+
+### Configuring OCDB specific storage locations
+
+Create a class called `OCDBCfg` deriving from `VirtualOCDBCfg` and put
+it in the script `OCDBConfig.C`. The function `OCDBConfig` _must_ set
+the global object pointer `ocdbCfg` to point to a new instance of the
+class `OCDBCfg`.
+
+The script `OCDBConfig.C` is executed by both `Simulate.C` and
+`Reconstruct.C` to set the list of specific storage locations.
+
+One can override `VirtualOCDBCfg::Prefix()` to return the default
+prefix for specific storage locations. The member function
+`VirtualOCDBCfg::Init(bool forSim)` _must_ declare all specific storage
+locations. The parameter `forSim` is true when executed from
+`Simulate.C` and false when executed from `Reconstruct.C`
+
+### Configuring the QA tasks
+
+Create the class `QACfg` deriving from `VirtualQACfg`, and override
+member functions from `VirtualQACfg` to enable/disable specific QA
+tasks and options. Put the class `QACfg` in the script `QAConfig.C`.
+The function `QAConfig` _must_ set the global object pointer
+`qaCfg` to point to a new instance of the class `QACfg`.
+
+The script `QAConfig.C` is executed by `QA.C` to set which tasks and
+features to include.
+
+### Configuring the AOD tasks
+
+Create the class `AODCfg` deriving from `VirtualAODCfg`, and override
+member functions from `VirtualAODCfg` to enable/disable specific AOD
+tasks and options. Put the class `AODCfg` in the script `AODConfig.C`.
+The function `AODConfig` _must_ set the global object pointer
+`aodCfg` to point to a new instance of the class `AODCfg`.
+
+The script `AODConfig.C` is executed by `AOD.C` to set which tasks and
+features to include.
+
+
## The files
* `run.sh`: main steering executable (same as
* `Check.C`: Perform ESD check. Derived from `CheckESD.C`.
* `Config.C`: Simulation configuration script. Uses `GRP.C` to
automatically load the proper parameters for the Anchor run.
+* `DetConfig.C`: Configuration script that sets which detectors to
+ turn on. This is used by all passes to ensure consistency.
* `Final.jdl.in`: Skeleton for final merging JDL. This is used for
both QA and AOD filtering.
* `GRP.C`: Script that defines the global variable `grp` which is
tell.
* `Merge.jdl.in`: Skeleton for intermediate merging JDL. This is used for
both QA and AOD filtering.
+* `OCDBConfig.C`: Set-up specific storage locations for simulation
+ and reconstruction. It defines the global object ocdbCfg which is
+ used in the `Simulate.C` and `Reconstruct.C` scripts.
* `QA.C`: QA train set-up. Derived from `QAtrainsim.C` but
modified to automatically get GRP parameters from OCDB using the
script `GRP.C` and set-up the train accordingly. Also, selection of
-Int_t getIntEnv(const char* name)
-{
- TString env = gSystem->Getenv(name);
- if (env.IsNull()) return 0;
- return env.Atoi();
-}
-void SetSpecStore(AliCDBManager& s,
- const char* key,
- const char* sub)
-{
- s.SetSpecificStorage(key, Form("alien://Folder=/alice/simulation/%s",sub));
-}
-
-
+/**
+ * Run the reconstruction
+ *
+ * @param run Run number
+ */
void Reconstruct(UInt_t run)
{
// -----------------------------------------------------------------
// Get GRP parameters. Defines global "grp" as a pointer to GRPData
//
gROOT->Macro(Form("GRP.C(%d)", run));
-
+ gROOT->Macro("DetConfig.C");
+ gROOT->Macro("OCDBConfig.C");
+
+ // --- Get GRP to deduce collision system --------------------------
+ Bool_t isAA = grp->IsAA();
+ Bool_t is10h = grp->period.EqualTo("LHC10h");
+
// -----------------------------------------------------------------
//
// Basic setup
//
AliReconstruction reco;
- reco.SetRunReconstruction("ITS TPC TRD TOF PHOS HMPID "
- "EMCAL MUON FMD ZDC PMD T0 VZERO");
-
+ TString enable;
+ detCfg->GetRecoString(enable);
+ if (is10h) enable.ReplaceAll("MUON", "");
+ reco.SetRunReconstruction(enable);
// -----------------------------------------------------------------
//
- // switch off cleanESD, write ESDfriends and Alignment data
+ // switch off cleanESD, write ESDfriends and Alignment data, clean
+ // up rec-points
//
reco.SetCleanESD(kFALSE);
reco.SetWriteESDfriend();
reco.SetFractionFriends(.1);
reco.SetWriteAlignmentData();
+ TString clean(enable); clean.ReplaceAll("ITS", "");
+ reco.SetDeleteRecPoints(clean);
// -----------------------------------------------------------------
//
//
reco.SetRunPlaneEff(kTRUE);
reco.SetUseTrackingErrorsForAlignment("ITS");
-
// -----------------------------------------------------------------
//
//
AliCDBManager* man = AliCDBManager::Instance();
man->SetDefaultStorageFromRun(grp->run);
+ ocdbCfg->Init(false);
- // --- Get GRP to deduce collision system --------------------------
- Bool_t isAA = grp->IsAA();
- Bool_t is10h = grp->period.EqualTo("LHC10h");
-
- // --- ITS (2 objects) ---------------------------------------------
- SetSpecStore(*man,"ITS/Align/Data", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"ITS/Calib/SPDSparseDead", "2008/v4-15-Release/Residual");
-
-
- // --- MUON objects (1 object) -------------------------------------
- SetSpecStore(*man,"MUON/Align/Data", "2008/v4-15-Release/Residual");
-
- // --- TPC (7 objects) ---------------------------------------------
- SetSpecStore(*man,"TPC/Align/Data", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"TPC/Calib/ClusterParam", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"TPC/Calib/RecoParam", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"TPC/Calib/TimeGain", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"TPC/Calib/AltroConfig", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"TPC/Calib/TimeDrift", "2008/v4-15-Release/Residual");
- SetSpecStore(*man,"TPC/Calib/Correction", "2008/v4-15-Release/Residual");
-
-
+ // -----------------------------------------------------------------
+ //
+ // Specific reconstruction parameters
+ //
// --- ZDC ---------------------------------------------------------
// ZDC for 2010 the following is needed
// (https://savannah.cern.ch/task/?func=detailitem&item_id=33180#comment46)
- if (is10h) {
+ if (is10h)
reco.SetRecoParam("ZDC",AliZDCRecoParamPbPb::GetHighFluxParam(2760));
- SetSpecStore(*man,"ZDC/Align/Data", "2008/v4-15-Release/Ideal/");
- }
-
- // --- GRP from local OCDB -----------------------------------------
- // man->SetSpecificStorage("GRP/GRP/Data",
- // Form("local://%s",gSystem->pwd()));
-
// --- Override some settings in the ITS reco ----------------------
if (is10h) {
InputFile={
"LF:@data@/Check.C",
"LF:@data@/Config.C",
+ "LF:@data@/DetConfig.C",
+ "LF:@data@/OCDBConfig.C",
"LF:@data@/Reconstruct.C",
"LF:@data@/Simulate.C",
"LF:@data@/simrun.sh",
};
#
-splitarguments="--run $1 --event $3 --process $5 --qa --aod --number #alien_counter#";
+splitarguments="--run $1 --event $3 --process $5 --qa --aod --check --number #alien_counter# --bmin 0 --bmax 3";
split="production:1-$2";
-Workdirectorysize={"5000MB"};
+Workdirectorysize={"10000MB"};
-/**
- * Read an integer valued environment variable
- *
- * @param name environment variable name
- *
- * @return Value or 0
- */
-Int_t getIntEnv(const char* name)
-{
- TString env = gSystem->Getenv(name);
- if (env.IsNull()) return 0;
- return env.Atoi();
-}
-/**
- * Set specific storage
- *
- * @param s Simlation object
- * @param key Key to set specific storage for
- * @param sub Sub-component of storage
- */
-void SetSpecStore(AliSimulation& s,
- const char* key,
- const char* sub)
-{
- s.SetSpecificStorage(key, Form("alien://Folder=/alice/simulation/%s",sub));
-}
-
/**
* Run the simulation
*
// Get GRP parameters. Defines global "grp" as a pointer to GRPData
//
gROOT->Macro(Form("GRP.C(%d)", run));
+ gROOT->Macro("DetConfig.C");
+ gROOT->Macro("OCDBConfig.C");
// --- Get GRP to deduce collision system --------------------------
Bool_t isAA = grp->IsAA();
// Basic setup
//
AliSimulation steer;
- steer.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
- steer.SetMakeDigitsFromHits("ITS TPC");
+ TString sDigits, fromHits;
+ detCfg->GetSDigitString(sDigits);
+ detCfg->GetHits2DigitsString(fromHits);
+ steer.SetMakeSDigits(sDigits);
+ steer.SetMakeDigitsFromHits(fromHits);
// -----------------------------------------------------------------
//
// -----------------------------------------------------------------
//
- // Raw OCDB
+ // OCDB and specific storages
//
AliCDBManager* cdb = AliCDBManager::Instance();
cdb->SetDefaultStorageFromRun(grp->run);
- // cdb->SetRun(grp.run);
- steer.SetDefaultStorage(cdb->GetDefaultStorage()->GetURI());
-
- // --- ITS (1 Total) ----------------------------------------------
- SetSpecStore(steer,"ITS/Align/Data", "2008/v4-15-Release/Ideal");
-
- // --- MUON (1 object) ---------------------------------------------
- SetSpecStore(steer,"MUON/Align/Data", "2008/v4-15-Release/Ideal");
-
- // ---- TPC (6 total) ----------------------------------------------
- SetSpecStore(steer,"TPC/Calib/TimeGain", "2008/v4-15-Release/Ideal/");
- SetSpecStore(steer,"TPC/Calib/ClusterParam", "2008/v4-15-Release/Ideal/");
- SetSpecStore(steer,"TPC/Calib/AltroConfig", "2008/v4-15-Release/Ideal/");
- SetSpecStore(steer,"TPC/Calib/Correction", "2008/v4-15-Release/Ideal/");
- SetSpecStore(steer,"TPC/Align/Data", "2008/v4-15-Release/Ideal/");
- SetSpecStore(steer,"TPC/Calib/RecoParam", "2008/v4-15-Release/Residual");
- if (is10h)
- SetSpecStore(steer,"TPC/Calib/TimeDrift", "2008/v4-15-Release/Residual/");
- else
- SetSpecStore(steer,"TPC/Calib/TimeDrift", "2008/v4-15-Release/Ideal/");
-
- // --- ZDC for 2010 the following is needed ------------------------
- // (https://savannah.cern.ch/task/?func=detailitem&item_id=33180#comment46)
- if (is10h)
- SetSpecStore(steer,"ZDC/Align/Data", "2008/v4-15-Release/Ideal/");
-
+ ocdbCfg->Init(true);
// -----------------------------------------------------------------
//
- // The rest - disable QA for PbPb
+ // The rest - disable QA and HLT (memory heavy) for PbPb
//
if (isAA) steer.SetRunQA(":");
- // gInterpreter->UnloadFile("GetGRP.C");
-
+ if (is10h) steer.SetRunHLT("");
+
TStopwatch timer;
timer.Start();
steer.Run(nev);
-void Tag() {
+//____________________________________________________________________
+void Tag()
+{
const char* turl = gSystem->Getenv("ALIEN_JDL_OUTPUTDIR");
gSystem->Load("libNet.so");
TString fGUID = 0;
GetGUID(fGUID);
- gEnv->Print();
+ // gEnv->Print();
TString fAliroot, fRoot, fGeant;
GetVersions(fAliroot,fRoot,fGeant);
UpdateTag(fAliroot,fRoot,fGeant,fESDFileName,fGUID,fPeriod,fPass,fName);
}
-//_____________________________________//
-GetProductionInfo(TString &fPeriod, TString &fPass, TString &fName) {
+//____________________________________________________________________
+void GetProductionInfo(TString &fPeriod, TString &fPass, TString &fName)
+{
const char* turl = gSystem->Getenv("ALIEN_JDL_OUTPUTDIR");
TString fS = turl;
fName = fPeriod+"."+fPass;
}
-//_____________________________________//
-GetVersions(TString &fAliroot, TString &froot, TString &fgeant) {
+//____________________________________________________________________
+void GetVersions(TString &fAliroot, TString &froot, TString &fgeant)
+{
const char* fver = gSystem->Getenv("ALIEN_JDL_PACKAGES");
TString fS = fver;
Int_t fFirst = fS.First("#");
}
}
-//_____________________________________//
-GetGUID(TString &guid) {
+//____________________________________________________________________
+void GetGUID(TString &guid)
+{
ofstream myfile ("guid.txt");
- if (myfile.is_open()) {
- TFile *f = TFile::Open("AliESDs.root","read");
- if(f && !f->IsZombie() && f->IsOpen()) {
- guid = f->GetUUID().AsString();
- myfile << "AliESDs.root \t"<<f->GetUUID().AsString();
- cout<<guid.Data()<<endl;
- myfile.close();
- }
- else cout<<"Input file not found"<<endl;
+ if (!myfile.is_open()) {
+ Warning("GetGUID", "Couldn't open guid.txt for writing");
+ return;
+ }
+
+ TFile *f = TFile::Open("AliESDs.root","read");
+ if (!f || f->IsZombie() || !f->IsOpen()) {
+ Warning("GetGUID", "Input file AliESDs.root not found");
+ return;
}
- else cout<<"Output file can't be created..."<<endl;
+
+ guid = f->GetUUID().AsString();
+ f->Close();
+ Info("", "Global Unique IDentifier: %s", guid.Data());
+
+ myfile << "AliESDs.root \t"<< guid << std::endl;
+ myfile.close();
}
-//_____________________________________//
-Bool_t UpdateTag(TString faliroot, TString froot, TString fgeant,
- TString turl, TString guid,
- TString fperiod, TString fpass, TString fname) {
- cout<<"> Updating tags...."<<endl;
+//____________________________________________________________________
+Bool_t UpdateTag(TString faliroot,
+ TString froot,
+ TString fgeant,
+ TString turl,
+ TString guid,
+ TString fperiod,
+ TString fpass,
+ TString fname)
+{
+ Info("", "Updating tags (%s,%s,%s,%s,%s,%s,%s,%s",
+ faliroot.Data(), froot.Data(), fgeant.Data(),
+ turl.Data(), guid.Data(), fperiod.Data(),
+ fpass.Data(),fname.Data());
const TString tagPattern = "tag.root";
- // Open the working directory
+
+ // --- Open the working directory ----------------------------------
TSystemDirectory dir(".", gSystem->pwd());
TIter next(dir.GetListOfFiles());
TSystemFile* file = 0;
- // Add all files matching *pattern* to the chain
+
+ // --- Add all files matching *pattern* to the chain ---------------
while ((file = static_cast<TSystemFile*>(next()))) {
TString name(file->GetName());
if (!name.Contains(tagPattern)) continue;
+ // --- Open file matching pattern --------------------------------
TFile* f = TFile::Open(name,"read") ;
+ if (!f) {
+ continue;
+ }
+ Info("", "Updating tags in %s", name.Data());
+
+ // --- Find the tree ---------------------------------------------
AliRunTag* tag = 0x0;
AliFileTag* flTag = 0x0;
TTree* fTree = (TTree *)f->Get("T");
}
fTree->SetBranchAddress("AliTAG",&tag);
- //Defining new tag objects
+ // --- Defining new tag objects ----------------------------------
AliRunTag* newTag = 0x0;
TTree ttag("T","A Tree with event tags");
TBranch* btag = ttag.Branch("AliTAG", &newTag);
btag->SetCompressionLevel(9);
+ // --- disassociate the tree with underlying directory -----------
+ ttag.SetDirectory(0);
Printf(">>>>> Found %d entries....",fTree->GetEntries());
delete tag;
delete newTag;
}//tag file loop
+
+ // --- Close the input file --------------------------------------
+ f->Close();
+ // --- Overwrite the file ----------------------------------------
TFile* ftag = TFile::Open(name, "recreate");
ftag->cd();
ttag.Write();
ftag->Close();
+ Info("", "Overwrote %s with new tags", name.Data());
}//directory loop
return kTRUE;
}
GRP.C \
Simulate.C \
Config.C \
+ DetConfig.C \
+ OCDBConfig.C \
Reconstruct.C \
Check.C \
Tag.C \
echo "* $type : $scr"
echo "* $type : $scr" >&2
-
+ date
+ echo "Starting ${type} ${scr}" >> $log
+ date >> $log
+
time aliroot -b -q -x $scr 2> /dev/stdout | tee -a $log
local ext=$?
local exp=${5-0}
echo "* $scr finished with the expected exit code ($exp), moving on"
echo "* $scr finished with the expected exit code ($exp), moving on" >&2
fi
+
+ echo "End of ${type} ${scr}" >> $log
+ date >> $log
+ echo "Disk usage in kB per file:" >> $log
+ du -sk * | sort -n -r >> $log
+ echo "Total disk usage: " >> $log
+ du -sh . >> $log
+
}
#
number=0
runAODTrain=0
runQATrain=0
+runCheck=0
while test "x$1" != "x"; do
option="$1"
--number) number="$1"; shift ;;
--qa) runQATrain=1 ;;
--aod) runAODTrain=1 ;;
+ --check) runCheck=1 ;;
+ --no-aod) runAODTrain=0 ;;
+ --no-qa) runQATrain=0 ;;
+ --no-check) runCheck=0 ;;
*) echo "Unkown option: $option" >&2
esac
done
echo "SIMRUN: Now read to process"
+# --- Run simulation (out: hits, digits, sdigits) --------------------
runcommand "SIMULATION" "Simulate.C($DC_EVENT,$DC_RUN)" sim.log 5
+rm -f *.Hits.root
+
+# --- Run reconstruction (in: digits, sdigits, raw out: ESDs) --------
runcommand "RECONSTRUCTION" "Reconstruct.C($DC_RUN)" rec.log 10
+rm -f *.Digits.root *.SDigits.root
+cleanRecPoints 0
+
+# --- Create tags (in: ESDs) -----------------------------------------
runcommand "TAG" "Tag.C" tag.log 50
-runcommand "CHECK" "Check.C" check.log 60
+
+# --- Run the check --------------------------------------------------
+if test $runCheck -gt 0 ; then
+ runcommand "CHECK" "Check.C" check.log 60
+fi
+
+# --- Possibly run QA analysis ---------------------------------------
if test $runQATrain -gt 0 ; then
runcommand "QA" "QA.C($DC_RUN)" qa.log 100
fi
+
+# --- Possibly run AOD analysis --------------------------------------
if test $runAODTrain -gt 0 ; then
runcommand "AOD" "AOD.C($DC_RUN)" aod.log 100
fi
-rm -f *.Hits.root *.Digits.root *.SDigits.root
-cleanRecPoints 0
exit 0
#
--- /dev/null
+#!/bin/bash
+
+pid=
+file=
+out=
+tee=0
+twait=30
+
+
+# --- Call on errors -------------------------------------------------
+error()
+{
+ echo "$@" > /dev/stderr
+ exit 1
+}
+
+# --- Help -----------------------------------------------------------
+usage()
+{
+ cat <<EOF
+Usage: $0 -p PID -f FILE [OPTIONS]
+
+Options:
+ -p,--pid PID Process identifier
+ -f,--file FILENAME File to monitor
+ -o,--out NAME Name of stored file
+ -w,--wait SECONDDS How many seconds to wait
+ -P,--pipe Use a tee when writing to file
+ -h,--help This help
+
+Output file is PID_NAME.log. If NAME is not specified it defaults to
+the base name of FILENAME minus possible ending .log.
+
+EOF
+}
+
+# --- Process command line -------------------------------------------
+while test $# -gt 0 ; do
+ case $1 in
+ -p|--pid) pid=$2 ; shift ;;
+ -f|--file) file=$2 ; shift ;;
+ -o|--out) out=$2 ; shift ;;
+ -w|--wait) twait=$2 ; shift ;;
+ -P|--pipe) tee=1 ;;
+ -h|--help) usage ; exit 0 ;;
+ *) error "Unknown option: $1" ;;
+ esac
+ shift
+done
+
+# --- Check settings -------------------------------------------------
+if test "X$pid" = "X" ; then error "No PID specified" ; fi
+if test "X$file" = "X" ; then error "No file specified" ; fi
+if test "X$out" = "X" ; then
+ out=`basename $file .log`
+fi
+
+# --- Make derived variables -----------------------------------------
+tmp=${pid}_${out}.tmp
+log=${pid}_${out}.log
+
+# --- Check grid authenticity ----------------------------------------
+if test ! -f /tmp/gclient_env_${UID} ; then
+ error "No AliEn environment file"
+fi
+. /tmp/gclient_env_${UID}
+alien-token-info | grep -q "Token is still valid"
+if test $? -ne 0 ; then
+ echo "Token not valid, please re-new" > /dev/stderr
+ exit 1
+fi
+
+
+# --- Main loop (eternal) --------------------------------------------
+while true ; do
+ if test $tee -gt 0 ; then
+ echo "=== Executing alien_spy $pid $file | tee $tmp ..."
+ alien_spy $pid $file | tee $tmp
+ else
+ echo "=== Executing alien_spy $pid $file > $tmp ..."
+ alien_spy $pid $file > $tmp
+ fi
+ l1=`stat -c %s $tmp`
+ l2=`stat -c %s $log`
+ if test $l1 -ge $l2 ; then
+ mv $tmp $log
+ else
+ echo "New download smaller than old - exiting"
+ break
+ fi
+ sleep $twait
+done
+
+
+#
+# EOF
+#
AODConfig.C \
Check.C \
Config.C \
+ DetConfig.C \
+ OCDBConfig.C \
GRP.C \
QA.C \
QAConfig.C \
for i in $files ; do
cp -v $i test/`basename $i`
done
+opts=
+if test "x$run" = "x138190" ; then
+ opts="--bmin 0 --bmax 1"
+fi
-(cd test && ../run.sh --run $run --event $nev --qa --aod $@)
+(cd test && ../run.sh --run $run --event $nev --qa --aod ${opts} $@)