/**
* This is the macro to include the FMD energy fitter in a train.
*
- * @param mc Assume MC input
- * @param useCent Use centrality information
- * @param debug Debug level
+ * @param mc Assume MC input
+ * @param useCent Use centrality information
+ * @param onlyMB Only collect statistics for MB (INEL) events
+ * @param debug Debug level
* @param residuals If set, also do residuals
*
* @return Newly created task
* @ingroup pwglf_forward_eloss
*/
AliAnalysisTask*
-AddTaskFMDELoss(Bool_t mc, Bool_t useCent, Int_t debug=0,
+AddTaskFMDELoss(Bool_t mc,
+ Bool_t useCent,
+ Bool_t onlyMB=false,
+ Int_t debug=0,
const Char_t* residuals="")
{
// --- Load libraries ----------------------------------------------
// --- Make the task and add it to the manager ---------------------
AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("ForwardELoss");
- // task->SetBLow(blow);
- // task->SetBLow(bhigh);
-
// --- Set parameters on the algorithms ----------------------------
// Set the number of SPD tracklets for which we consider the event a
// low flux event
// Set the minimum number of entries in the distribution before
// trying to fit to the data - 10K seems the absolute minimum
task->GetEnergyFitter().SetMinEntries(10000);
- // Debug
+ // If set, only collect statistics for MB. This is to prevent a
+ // bias when looping over data where the MB trigger is downscaled.
+ task->SetOnlyMB(onlyMB);
+ // Debug
task->SetDebug(debug);
TString resi(residuals);
: AliBaseESDTask(),
fEventInspector(),
fEnergyFitter(),
- fbLow(0),
- fbHigh(100)
+ fOnlyMB(false)
{
//
// Constructor
: AliBaseESDTask(name, "", &(AliForwardCorrectionManager::Instance())),
fEventInspector("event"),
fEnergyFitter("energy"),
- fbLow(0),
- fbHigh(100)
+ fOnlyMB(false)
{
//
// Constructor
fEnergyFitter.CreateOutputObjects(fList);
+ fList->Add(AliForwardUtil::MakeParameter("onlyMB", fOnlyMB));
return true;
}
//____________________________________________________________________
// We want only the events found by off-line
if (!(triggers & AliAODForwardMult::kOffline)) return false;
+ // Perhaps we should also insist on MB only
+ if (fOnlyMB && (!(triggers & AliAODForwardMult::kInel))) return false;
+
// if(cent > 0) {
// if( cent < 40 || cent >50 ) return;
// else std::cout<<"selecting event with cent "<<cent<<std::endl;
return true;
}
+#define PFB(N,FLAG) \
+ do { \
+ AliForwardUtil::PrintName(N); \
+ std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
+ } while(false)
//____________________________________________________________________
void
AliFMDEnergyFitterTask::Print(Option_t* option) const
//
AliBaseESDTask::Print(option);
gROOT->IncreaseDirLevel();
+ PFB("Only MB", fOnlyMB);
fEnergyFitter.Print(option);
gROOT->DecreaseDirLevel();
}
*/
void SetDebug(Int_t dbg);
/**
- * Set low cut on B
+ * Set whether to only look at MB (INEL) data, so as to avoid
+ * bias from different trigger scalars.
*
- * @param b Low cut
+ * @param onlyMB if true, only analyse MB events
*/
- void SetBLow(Float_t b) {fbLow = b;}
- /**
- * Set high cut on B
- *
- * @param b high cut
- */
- void SetBHigh(Float_t b) {fbHigh = b;}
+ void SetOnlyMB(Bool_t onlyMB) { fOnlyMB = onlyMB; }
/* @} */
/**
* @{
AliFMDEventInspector fEventInspector; // Algorithm
AliFMDEnergyFitter fEnergyFitter; // Algorithm
- Float_t fbLow; // What's this?
- Float_t fbHigh; // What's this?
-
- ClassDef(AliFMDEnergyFitterTask,3) // Forward multiplicity class
+ Bool_t fOnlyMB; // Only MB flag
+
+ ClassDef(AliFMDEnergyFitterTask,4) // Forward multiplicity class
};
#endif
: TrainSetup(name)
{
fOptions.Add("cent", "Use centrality");
+ fOptions.Add("only-mb", "Only collect statistics from MB events");
fOptions.Add("residuals", "MODE", "Optional calculation of residuals", "");
fOptions.Set("type", "ESD");
}
gROOT->GetMacroPath()));
// --- Check if this is MC ---------------------------------------
- Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
- Bool_t cent = fOptions.Has("cent");
- Int_t verb = fOptions.AsInt("verbose");
- TString resi = "";
+ Bool_t mc = HasMCHandler();
+ Bool_t cent = fOptions.Has("cent");
+ Bool_t onlyMB = fOptions.AsBool("only-mb");
+ Int_t verb = fOptions.AsInt("verbose");
+ TString resi = "";
if (fOptions.Has("residuals")) resi = fOptions.Get("residuals");
// --- Add the task ----------------------------------------------
- gROOT->Macro(Form("AddTaskFMDELoss.C(%d,%d,%d,\"%s\")",
- mc, cent, verb, resi.Data()));
+ AddTask("AddTaskFMDELoss.C", Form("%d,%d,%d,%d,\"%s\")",
+ mc, cent, onlyMB, verb, resi.Data()));
}
/**
* Create entrality selection if enabled
}
void PostShellCode(std::ostream& f)
{
- Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
+ Bool_t mc = HasMCHandler();
f << " echo \"=== Extracting Corrections ...\"\n"
<< " aliroot -l -b -q ${prefix}Extract.C\n"
<< " echo \"=== Summarizing results ...\"\n"