using namespace std;
-// FIXME: bookkeep here all parameters of centrality estimate (files, estimator, selected bin...)
ClassImp(AliAnalysisMultPbCentralitySelector)
if(!trackCuts){
AliFatal("Track cuts object is invalid");
}
- // cout << "Hey!" << endl;
+ // cout << "Hey! " << fCentrBin << " " << fMultMin <<" - " << fMultMax << endl;
if (fCentrBin == -1) return kTRUE;
if (trackCuts->CountAcceptedTracks(aEsd) < fMultMin) return kFALSE;
if (trackCuts->CountAcceptedTracks(aEsd) > fMultMax) return kFALSE;
- }
+ } else {
- AliESDCentrality *centrality = aEsd->GetCentrality();
- if(!centrality && !fUseMultRange) {
- AliFatal("Centrality object not available");
- }
- else {
- Int_t centrBin = centrality->GetCentralityClass5(fCentrEstimator.Data()) ;
- if (centrBin != fCentrBin && fCentrBin != -1 && !fUseMultRange) return kFALSE;
+ AliESDCentrality *centrality = aEsd->GetCentrality();
+ if(!centrality && !fUseMultRange) {
+ AliFatal("Centrality object not available");
+ }
+ else {
+ Int_t centrBin = centrality->GetCentralityClass5(fCentrEstimator.Data()) ;
+ if (centrBin != fCentrBin && fCentrBin != -1 && !fUseMultRange) return kFALSE;
+ }
}
// cout << "Selected" << endl;
AliInfo(Form("Booking %s",hname.Data()));
// Binning from Jacek task
+ // const Int_t nptbins = 49;
+ // const Double_t binsPt[] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0};//,11.0,12.0,13.0,14.0,15.0,16.0,18.0,20.0,22.0,24.0,26.0,28.0,30.0,32.0,34.0,36.0,40.0,45.0,50.0};
const Int_t nptbins = 68;
const Double_t binsPt[] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,18.0,20.0,22.0,24.0,26.0,28.0,30.0,32.0,34.0,36.0,40.0,45.0,50.0};
// Author: Michele Floris, CERN
// TODO:
// - Add chi2/cluster plot for primary, secondaries and fakes
-// FIXME:
-// - re-implement centrality estimator to cut on tracks and multiplicity
#include "AliAnalysisTaskMultPbTracks.h"
#include "AliESDInputHandler.h"
return kTRUE;
}
+
+// void AliAnalysisTaskEvil::PrintProcInfo()
+// {
+// ProcInfo_t info;
+// gSystem->GetProcInfo(&info);
+// AliInfo(Form("fMemResident=%10ld kB fMemVirtual=%10ld kB",info.fMemResident,info.fMemVirtual));
+// }
#include "AliMultiplicity.h"
#include "TFile.h"
#include "AliLog.h"
+#include "AliESDtrackCuts.h"
using namespace std;
AliAnalysisTaskTriggerStudy::AliAnalysisTaskTriggerStudy()
: AliAnalysisTaskSE("TaskTriggerStudy"),
- fESD(0),fHistoList(0),fIsMC(0),fTriggerAnalysis(0),fHistoSuffix(""),fNTrackletsCut(1000000)
+ fESD(0),fHistoList(0),fIsMC(0),fTriggerAnalysis(0),fHistoSuffix(""),fNTrackletsCut(1000000),fNTrackletsCutKine(100),fRejectBGWithV0(0)
{
// constructor
}
AliAnalysisTaskTriggerStudy::AliAnalysisTaskTriggerStudy(const char * name)
: AliAnalysisTaskSE(name),
- fESD(0),fHistoList(0),fIsMC(0),fTriggerAnalysis(0),fHistoSuffix(""),fNTrackletsCut(1000000)
+ fESD(0),fHistoList(0),fIsMC(0),fTriggerAnalysis(0),fHistoSuffix(""),fNTrackletsCut(1000000),fNTrackletsCutKine(100),fRejectBGWithV0(0)
{
//
// Standard constructur which should be used
}
AliAnalysisTaskTriggerStudy::AliAnalysisTaskTriggerStudy(const AliAnalysisTaskTriggerStudy& obj) :
- AliAnalysisTaskSE(obj) ,fESD (0), fIsMC(0), fTriggerAnalysis(0),fHistoSuffix("")
+ AliAnalysisTaskSE(obj) ,fESD (0), fIsMC(0), fTriggerAnalysis(0),fHistoSuffix(""),fNTrackletsCut(1000000),fNTrackletsCutKine(100),fRejectBGWithV0(0)
{
//copy ctor
fESD = obj.fESD ;
fHistoList = obj.fHistoList;
fTriggerAnalysis = obj.fTriggerAnalysis;
fHistoSuffix = obj.fHistoSuffix;
+ fNTrackletsCut = obj.fNTrackletsCut;
+ fNTrackletsCutKine = obj.fNTrackletsCutKine;
+ fRejectBGWithV0 = obj.fRejectBGWithV0;
}
AliAnalysisTaskTriggerStudy::~AliAnalysisTaskTriggerStudy(){
// Reset histo suffix and fill reference histograms without any suffix
fHistoSuffix = "";
- GetHistoTracklets("all","All events")->Fill(ntracklets);
// Fast or in the outer layer
Int_t nFastOrOnline = fTriggerAnalysis->SPDFiredChips(fESD, 1, 0, 2); // offline
Bool_t v0AHW = (fTriggerAnalysis->V0Trigger(fESD, AliTriggerAnalysis::kASide, kTRUE) == AliTriggerAnalysis::kV0BB);// should replay hw trigger
Bool_t v0CHW = (fTriggerAnalysis->V0Trigger(fESD, AliTriggerAnalysis::kCSide, kTRUE) == AliTriggerAnalysis::kV0BB);// should replay hw trigger
+ Bool_t v0ABG = fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kV0ABG);
+ Bool_t v0CBG = fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kV0CBG);
+ Bool_t v0BG = v0ABG || v0CBG;
+
+
// TOF triggers
// FIXME: move to triggeranalysis?
AliESDHeader*h = fESD->GetHeader(); // taken the header from AliESDEvent
vdArray[kVDC0VBC] = c0v0C;
//vdArray[kVDC0OM2] = c0OM2;
+ // Reject background
+ if (v0BG && fRejectBGWithV0) {
+ cout << "Rejection BG" << endl;
+
+ return;
+ }
+ // Fill global histos
+ GetHistoTracklets("all","All events")->Fill(ntracklets);
FillTriggerOverlaps("All", "All Events",vdArray);
// Fill some combination of trigger classes
Bool_t cmbs1cOnline = fESD->IsTriggerClassFired("CMBS1C-B-NOPF-ALL");
Bool_t cmbacOnline = fESD->IsTriggerClassFired("CMBAC-B-NOPF-ALL");
- if (cmbs1aOnline || cmbs1cOnline ||cmbacOnline) GetHistoTracklets("TwoOutOfThree" ,"Events 2-out-of-3 online" )->Fill(ntracklets);
+ Bool_t twoOutOfThree = kFALSE;
+ if (cmbs1aOnline || cmbs1cOnline ||cmbacOnline) twoOutOfThree = kTRUE;
+ if (twoOutOfThree) GetHistoTracklets("All_TwoOutOfThree" ,"Events 2-out-of-3 online" )->Fill(ntracklets);
// loop over trigger classes in the event
// if (trg.Contains("SMH")) cout << itoken++ << " " << trg.Data() << endl;
// Fill tracklets
- GetHistoTracklets("All" ,"Events no offline trigger" )->Fill(ntracklets);
+ GetHistoTracklets("All" ,"Events no offline trigger" )->Fill(ntracklets);
// Fill histograms mismatchs
if(cMBS2C) GetHistoTracklets("cMBS2C","Events were trigger cMBS2C fired")->Fill(ntracklets);
if(cMBAC ) GetHistoTracklets("cMBAC", "Events were trigger cMBAC fired")->Fill(ntracklets);
if(zdcA ) GetHistoTracklets("cZDCA", "Events were trigger cZDCA fired")->Fill(ntracklets);
- if(zdcC ) GetHistoTracklets("cZDCC", "Events were trigger cZDCC fired")->Fill(ntracklets);
+ if(zdcC ) GetHistoTracklets("cZDCC", "Events were trigger cZDCC fired")->Fill(ntracklets);
+ if(!zdcA && !zdcC ) GetHistoTracklets("NoZDC", "Events were zdc trigger don't fired")->Fill(ntracklets);
+ if( (zdcA && !zdcC) || (!zdcA && zdcC) ) GetHistoTracklets("OneSideZDC", "Events were only 1 ZDC fired")->Fill(ntracklets);
+ if( (zdcA && zdcC) ) GetHistoTracklets("TwoSideZDC", "Events were both ZDC fired")->Fill(ntracklets);
+
+ if(twoOutOfThree) {
+ if(!zdcA && !zdcC ) GetHistoTracklets("NoZDC_TwoOutOfThree", "Events were zdc trigger don't fired")->Fill(ntracklets);
+ if( (zdcA && !zdcC) || (!zdcA && zdcC) ) GetHistoTracklets("OneSideZDC_TwoOutOfThree", "Events were only 1 ZDC fired")->Fill(ntracklets);
+ if( (zdcA && zdcC) ) GetHistoTracklets("TwoSideZDC_TwoOutOfThree", "Events were both ZDC fired")->Fill(ntracklets);
+ }
if(zdcBar) GetHistoTracklets("cZDCBar","Events were trigger cZDCB fired")->Fill(ntracklets);
// if() GetHistoTracklets("","Events were trigger fired");
// Fill trigger overlaps
FillTriggerOverlaps("All", "All Events in trigger class",vdArray);
+
+ // Fill kinematic variables for peripheral events
+ static AliESDtrackCuts * cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(); // FIXME: change this ?
+ if (ntracklets < fNTrackletsCutKine) {
+ // 1. Loop on tracklets
+ for(Int_t itracklet = 0; itracklet < ntracklets; itracklet++){
+ GetHistoEta("All", Form("Tracklet #eta distribution, ntracklets < %d",fNTrackletsCutKine))->Fill(mult->GetEta(itracklet));
+ }
+ // 2. loop on tracks
+ TObjArray * goodTracks = cuts->GetAcceptedTracks(fESD);
+ TIterator * iterTracks = goodTracks->MakeIterator();
+ AliESDtrack * esdTrack = 0;
+ while ((esdTrack = (AliESDtrack*) iterTracks->Next())) {
+ GetHistoPt("All", Form("Tracklet p_{T} distribution, ntracklets < %d",fNTrackletsCutKine))->Fill(esdTrack->Pt());
+ }
+ delete goodTracks;
+ }
+
+
}
delete tokens;
return h;
}
+TH1 * AliAnalysisTaskTriggerStudy::GetHistoEta(const char * name, const char * title){
+ // Book histo of events vs ntracklets, if needed
+
+ TString hname = "hEta_";
+ hname+=name;
+ hname+=fHistoSuffix;
+ TH1 * h = (TH1*) fHistoList->GetList()->FindObject(hname.Data());
+
+ if(!h) {
+ AliInfo(Form("Booking histo %s",hname.Data()));
+ Bool_t oldStatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+ // h = new TH1F (hname.Data(), title, 1000, -0.5, 10000-0.5);
+ h = new TH1F (hname.Data(), title, 20, -2, 2);
+ h->Sumw2();
+ h->SetXTitle("#eta");
+ fHistoList->GetList()->Add(h);
+ TH1::AddDirectory(oldStatus);
+ }
+ return h;
+}
+
+TH1 * AliAnalysisTaskTriggerStudy::GetHistoPt(const char * name, const char * title){
+ // Book histo of pt distribution, if needed
+
+ TString hname = "hPt_";
+ hname+=name;
+ hname+=fHistoSuffix;
+ TH1 * h = (TH1*) fHistoList->GetList()->FindObject(hname.Data());
+
+ if(!h) {
+ AliInfo(Form("Booking histo %s",hname.Data()));
+ Bool_t oldStatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+ // h = new TH1F (hname.Data(), title, 1000, -0.5, 10000-0.5);
+ h = new TH1F (hname.Data(), title, 100, -0.5, 1-0.5);
+ h->Sumw2();
+ h->SetXTitle("p_{T}");
+ fHistoList->GetList()->Add(h);
+ TH1::AddDirectory(oldStatus);
+ }
+ return h;
+}
+
void AliAnalysisTaskTriggerStudy::FillTriggerOverlaps (const char * name, const char * title, Bool_t * vdArray){
//Fills a histo with the different trigger statistics in a venn like diagramm. Books it if needed.
void SetIsMC(Bool_t flag=kTRUE) { fIsMC = flag;}
AliHistoListWrapper * GetHistoList() { return fHistoList;}
- void SetNTrackletsCut(Int_t cut) { fNTrackletsCut = cut;}
TH1 * GetHistoTracklets (const char * name, const char * title);
+ TH1 * GetHistoPt(const char * name, const char * title);
+ TH1 * GetHistoEta(const char * name, const char * title);
void FillTriggerOverlaps (const char * name, const char * title, Bool_t * vdArray) ;
+ void SetNTrackletsCut(Int_t cut){ fNTrackletsCut = cut;}
+ void SetNTrackletsCutKine(Int_t cut){ fNTrackletsCutKine = cut;}
+ void SetRejectBGWithV0(Bool_t flag) { fRejectBGWithV0 = flag;}
+
+
virtual void UserCreateOutputObjects();
virtual void UserExec(Option_t *option);
virtual void Terminate(Option_t *);
AliESDEvent * fESD; //! ESD object AliVEvent* fEvent;
AliHistoListWrapper * fHistoList; // wrapper for the list, takes care of merging + histo booking and getters
Bool_t fIsMC; // true if processing montecarlo
-
+
AliTriggerAnalysis * fTriggerAnalysis; // trigger analysis object, to get the offline triggers
TString fHistoSuffix; // suffix appended to all histos, set in the user exec.
Int_t fNTrackletsCut; // max number of tracklets
+ Int_t fNTrackletsCutKine; // max number of tracklets (only for kinematic distributions)
+
+ Bool_t fRejectBGWithV0; // Reject the BG with the V0
static const char * kVDNames[]; // names of the venn hist
AliAnalysisTaskTriggerStudy& operator=(const AliAnalysisTaskTriggerStudy& task);
iter = listToLoad->MakeIterator();
name = 0;
sources = "";
- plugin->SetAdditionalLibs(sources.Data());
+ // while (name = (TObjString *)iter->Next()) {
+ // gSystem->ExpandPathName(name->String());
+ // name->String().ReplaceAll("+","");
+ // sources = sources + gSystem->BaseName(name->String().Data()) + " ";
+ // }
while (name = (TObjString *)iter->Next()) {
gSystem->ExpandPathName(name->String());
name->String().ReplaceAll("+","");
sources = sources + name->String() + " ";
}
+ plugin->SetAdditionalLibs(sources.Data());
// I'm using a modified ANALYSISalice package, so I need to load par files for everything
// plugin->EnablePackage("STEERBase");
// plugin->EnablePackage("ESD");
--- /dev/null
+
+AliAnalysisGrid* CreateAlienHandlerTrigger(const char * run,const char * recopass="pass1", Bool_t isMC=kFALSE)
+{
+
+
+// Check if user has a valid token, otherwise make one. This has limitations.
+// One can always follow the standard procedure of calling alien-token-init then
+// source /tmp/gclient_env_$UID in the current shell.
+ TGrid::Connect("alien:");
+ AliAnalysisAlien *plugin = new AliAnalysisAlien();
+// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
+ plugin->SetRunMode("full");
+ //plugin->SetRunMode("test");
+// Set versions of used packages
+ plugin->SetAPIVersion("V1.1x");
+ plugin->SetROOTVersion("v5-27-06-2");
+ plugin->SetAliROOTVersion("v4-21-03-AN");
+// Declare input data to be processed.
+// Method 1: Create automatically XML collections using alien 'find' command.
+// Define production directory LFN
+// LHC09d
+// /alice/data/2009/LHC09d/000104892/ESDs/pass6/
+ if (!isMC)
+ plugin->SetGridDataDir(Form("/alice/data/2010/LHC10h/%s/ESDs/%s/", run,recopass));
+ else
+ plugin->SetGridDataDir(Form("/alice/sim/%s",recopass));
+// Set data search pattern
+ plugin->SetDataPattern("AliESDs.root");
+// ...then add run numbers to be considered
+// plugin->AddRunNumber(104892);
+// plugin->AddRunNumber(300001);
+// Method 2: Declare existing data files (raw collections, xml collections, root file)
+// If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
+// XML collections added via this method can be combined with the first method if
+// the content is compatible (using or not tags)
+ // plugin->AddDataFile("tag.xml");
+ // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
+// Define alien work directory where all files will be copied. Relative to alien $HOME.
+ plugin->SetGridWorkingDir(Form("MultPb/Task_%s_%s",run,recopass));
+// Declare alien output directory. Relative to working directory.
+ plugin->SetGridOutputDir("out");
+// Declare the analysis source files names separated by blancs. To be compiled runtime
+// using ACLiC on the worker nodes.
+ plugin->SetAnalysisSource("AliAnalysisTaskTriggerStudy.cxx AliHistoListWrapper.cxx");
+// Declare all libraries (other than the default ones for the framework. These will be
+// loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
+ plugin->SetAdditionalLibs("AliAnalysisTaskTriggerStudy.cxx AliHistoListWrapper.cxx AliAnalysisTaskTriggerStudy.h AliHistoListWrapper.h");
+// plugin->SetAdditionalLibs("AliCollisionsNormalization.cxx AliCollisionNormalizationTask.cxx AliPhysicsSelection.cxx AliCollisionsNormalization.h AliCollisionNormalizationTask.h AliPhysicsSelection.h");
+ // I'm using a modified ANALYSISalice package, so I need to load par files for everything
+ plugin->EnablePackage("STEERBase");
+ plugin->EnablePackage("ESD");
+ plugin->EnablePackage("AOD");
+ plugin->EnablePackage("CORRFW");
+ plugin->EnablePackage("ANALYSIS");
+ plugin->EnablePackage("ANALYSISalice");
+
+// Declare the output file names separated by blancs.
+// (can be like: file.root or file.root@ALICE::Niham::File)
+ plugin->SetDefaultOutputs(kFALSE);
+ // plugin->SetOutputFiles(Form("EventStat_temp.root %s",outfilename);
+ plugin->SetOutputFiles("Trig_Temp.root");
+// Optionally define the files to be archived.
+// plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
+ plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
+// Optionally set a name for the generated analysis macro (default MyAnalysis.C)
+ plugin->SetAnalysisMacro("AnalysisTrigger.C");
+// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
+ plugin->SetSplitMaxInputFileNumber(100);
+// Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
+ plugin->SetMaxInitFailed(5);
+// Optionally resubmit threshold.
+ plugin->SetMasterResubmitThreshold(90);
+// Optionally set time to live (default 30000 sec)
+ plugin->SetTTL(30000);
+// Optionally set input format (default xml-single)
+ plugin->SetInputFormat("xml-single");
+// Optionally modify the name of the generated JDL (default analysis.jdl)
+ plugin->SetJDLName("TaskNorm.jdl");
+// Optionally modify job price (default 1)
+ plugin->SetPrice(1);
+// Optionally modify split mode (default 'se')
+ plugin->SetSplitMode("se");
+ return plugin;
+}
CheckVz();
Double_t fractionWeak = 1, fractionMaterial=1;
- // CheckSecondaries(fractionWeak, fractionMaterial);
+ CheckSecondaries(fractionWeak, fractionMaterial);
cout << "Rescaling secondaries correction, weak: " << fractionWeak << ", material: " << fractionMaterial <<endl;
hCorrected->Fit(f,"", "same");
hCorrected->Fit(f,"IME", "same");
cout << "dN/deta = " << f->Integral(0,100) << " +- " << f->IntegralError(0,100) << endl;
- cout << "Generated dN/deta (correction) = " << hMCPtGen->Integral() << endl;
+ cout << "Generated dN/deta (correction) = " << hMCPtGen->Integral("width") << endl;
// FIXME: comment this out
TH1D * hDataGen = hManData->GetHistoPt(AliAnalysisMultPbTrackHistoManager::kHistoGen, -0.5,0.5,-10,10);
- cout << "Generated dN/deta (data) = " << hDataGen->Integral() << endl;
+ cout << "Generated dN/deta (data) = " << hDataGen->Integral("width") << endl;
hDataGen->Draw("same");
}
hMCDCASW ->Draw("same");
hMCDCASM ->Draw("same");
// compute scaling factors
- fracWeak = hMCDCASW->Integral()/(hMCPrimSMFak->Integral()+hMCDCASW->Integral()+hMCDCASM->Integral());
- fracMaterial = hMCDCASM->Integral()/(hMCPrimSMFak->Integral()+hMCDCASW->Integral()+hMCDCASM->Integral());
+ fracWeak = fHistos->GetParameter(1)/fHistos->GetParameter(0);
+ fracMaterial = fHistos->GetParameter(2)/fHistos->GetParameter(0);
}
// hManData->ScaleHistos(75351.36/1.015);// Nint for run 104892 estimated correcting for the trigger efficiency, multiplied for the physics selection efficiency which I'm not correcting for the time being
// hManData->ScaleHistos(hEvStatData->GetBinContent(AliPhysicsSelection::kStatAccepted,irowGoodTrigger));
// hManCorr->ScaleHistos(hEvStatCorr->GetBinContent(AliPhysicsSelection::kStatAccepted,irowGoodTrigger));
- hManData->ScaleHistos(hManData->GetHistoStats()->GetBinContent(2));
- hManCorr->ScaleHistos(hManCorr->GetHistoStats()->GetBinContent(2));
+ hManData->ScaleHistos(hManData->GetHistoStats()->GetBinContent(AliAnalysisMultPbTrackHistoManager::kStatVtx));
+ hManCorr->ScaleHistos(hManCorr->GetHistoStats()->GetBinContent(AliAnalysisMultPbTrackHistoManager::kStatVtx));
} else {
cout << "WARNING!!! ARBITRARY SCALING" << endl;
hManData->ScaleHistos(1000);
TChain * GetAnalysisChain(const char * incollection);
-void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0, Int_t centrBin = 0, const char * centrEstimator = "VOM", const char* option = "",TString customSuffix = "", Int_t workers = -1)
+void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0,
+ Int_t centrBin = 0, const char * centrEstimator = "VOM", Bool_t useTrackCentralityCut = kFALSE, Int_t trackMin=0, Int_t trackMax=10000,
+ const char* option = "",TString customSuffix = "", Int_t workers = -1)
{
// runMode:
//
// Add ESD handler
AliESDInputHandler* esdH = new AliESDInputHandler;
// Do I need any of this?
- // esdH->SetInactiveBranches("AliESDACORDE FMD ALIESDTZERO ALIESDZDC AliRawDataErrorLogs CaloClusters Cascades EMCALCells EMCALTrigger ESDfriend Kinks AliESDTZERO ALIESDACORDE MuonTracks TrdTracks");
+ esdH->SetInactiveBranches("AliESDACORDE FMD ALIESDTZERO ALIESDZDC AliRawDataErrorLogs CaloClusters Cascades EMCALCells EMCALTrigger ESDfriend Kinks AliESDTZERO ALIESDACORDE MuonTracks TrdTracks");
mgr->SetInputEventHandler(esdH);
if(isMC) {
// physics selection
gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
- physicsSelectionTask = AddTaskPhysicsSelection(isMC,1);
+ physicsSelectionTask = AddTaskPhysicsSelection(isMC,0);//FIXME
// FIXME!!
if(!isMC) {
AliPhysicsSelection * physSel = physicsSelectionTask->GetPhysicsSelection();
// physSel->AddCollisionTriggerClass("+CTRUE-B-NOPF-ALL");
- physSel->AddCollisionTriggerClass("+C0SM1-B-NOPF-ALL");
- physSel->AddBGTriggerClass ("+C0SM1-A-NOPF-ALL");
- physSel->AddBGTriggerClass ("+C0SM1-C-NOPF-ALL");
- physSel->AddBGTriggerClass ("+C0SM1-E-NOPF-ALL");
+ physSel->AddCollisionTriggerClass("+CMBAC-B-NOPF-ALL");
+ physSel->AddCollisionTriggerClass("+CMBS1C-B-NOPF-ALL");
+ physSel->AddCollisionTriggerClass("+CMBS1A-B-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBAC-C-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBS1C-C-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBS1A-C-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBAC-A-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBS1C-A-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBS1A-A-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBAC-E-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBS1C-E-NOPF-ALL");
+ physSel->AddBGTriggerClass("+CMBS1A-E-NOPF-ALL");
+ // physSel->AddBGTriggerClass ("+C0SM1-E-NOPF-ALL");
}
// Centrality
centrSelector->SetCentralityBin(centrBin);
centrSelector->SetCentralityEstimator(centrEstimator);
// FIXME!!!
- // centrSelector->SetUseMultRange();
- centrSelector->SetIsMC(isMC,1500,2300);
- // centrSelector->SetMultRange(10,20);
+
+ //centrSelector->SetIsMC(isMC,1500,2300);
+ if(useTrackCentralityCut){
+ centrSelector->SetUseMultRange();
+ centrSelector->SetMultRange(trackMin,trackMax);
+ }
// Parse option strings
TString optionStr(option);
cout << "ERROR: unknown run mode" << endl;
}
- pathsuffix = pathsuffix + "_" + centrEstimator + "_bin_"+long(centrBin);
+ if (!useTrackCentralityCut) {
+ pathsuffix = pathsuffix + "_" + centrEstimator + "_bin_"+long(centrBin);
+ } else {
+ pathsuffix = pathsuffix + "_TrackRange_" + long(trackMin) + "_" + long(trackMax);
+ }
pathsuffix += customSuffix;
if (doSave) MoveOutput(data, pathsuffix.Data());
gEnv->SetValue("XSec.GSI.DelegProxy", "2");
TProof::Open("alice-caf.cern.ch", workers>0 ? Form("workers=%d",workers) : "");
+ // TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");
// Enable the needed package
gProof->UploadPackage("$ALICE_ROOT/STEERBase");
correct=no
nev=-1
offset=0
-debug=kTRUE
+debug=kFALSE
runmode=1
dataset=/alice/sim/LHC10f8a_130844
ropt="-l"
centrEstimator="V0M"
runTriggerStudy=no
customSuffix=""
+ntrackletsTrigger=50
+rejectBGV0Trigger=kFALSE
+useTrackCentralityCut=kFALSE
+trackMin=0
+trackMax=100
give_help() {
- V0MvsFMD = correlation between V0 and FMD
- TKLvsV0 = correlation between tracklets and V0
- ZEMvsZDC = correlation between ZEM and ZDC
+ -y <min,max> Select centrality based on "good tracks" rather than on centrality
+ estimator [off by default]
-o <option> Misc option [default=$option]
Available options:
- SAVE: Move results to a different output folder*
-x <suffix> Set a custom suffix in the histo manager
-g Debug mode
-h This help
+
+ Options specific to the trigger study task
+ -k <ntracklets> Max number of tracklets to fill eta and pt
+ distributions [default=$ntrackletsTrigger]
+ -v Reject BG with the V0
ENDOFGUIDE
}
-while getopts "x:sr:cgmd:o:w:n:e:b:t:" opt; do
+while getopts "x:sr:cgmd:o:w:n:e:b:t:k:vy:" opt; do
case $opt in
r)
run=yes
runmode=$OPTARG
;;
+ y)
+ useTrackCentralityCut=kTRUE
+ trackMin=${OPTARG%%,*}
+ trackMax=${OPTARG##*,}
+ ;;
x)
customSuffix=$OPTARG
;;
+ k)
+ ntrackletsTrigger=$OPTARG
+ ;;
s)
runTriggerStudy=yes
;;
+ v)
+ rejectBGV0Trigger=kTRUE
+ ;;
c)
correct=yes
;;
then
if [ "$runTriggerStudy" = "yes" ]
then
- root $ropt runTriggerStudy.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,\"$option\",$workers\)
+ root $ropt runTriggerStudy.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$ntrackletsTrigger,$rejectBGV0Trigger,\"$option\",$workers\)
else
- root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",\"$option\",\"$customSuffix\",$workers\)
+ root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",$useTrackCentralityCut,$trackMin,$trackMax,\"$option\",\"$customSuffix\",$workers\)
fi
fi
-enum { kMyRunModeLocal = 0, kMyRunModeCAF};
+enum { kMyRunModeLocal = 0, kMyRunModeCAF, kMyRunModeGRID};
TChain * GetAnalysisChain(const char * incollection);
-void runTriggerStudy(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0, const char* option = "",Int_t workers = -1)
+void runTriggerStudy(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0, Int_t ntrackletsKine = 100, Bool_t rejectBGV0Trigger = kFALSE, const char* option = "", Int_t workers = -1)
{
// runMode:
//
mgr->SetMCtruthEventHandler(handler);
}
+ // If we are running on grid, we need the alien handler
+ if (runMode == kMyRunModeGRID) {
+ // Create and configure the alien handler plugin
+ gROOT->LoadMacro("CreateAlienHandlerTrigger.C");
+ AliAnalysisGrid *alienHandler = CreateAlienHandlerTrigger(data,"pass1",isMC);
+ if (!alienHandler) {
+ cout << "Cannot create alien handler" << endl;
+ exit(1);
+ }
+ mgr->SetGridHandler(alienHandler);
+ }
// Parse option strings
TString optionStr(option);
task->SetIsMC(isMC);
-
+ task->SetNTrackletsCutKine(ntrackletsKine);
+ task->SetRejectBGWithV0(rejectBGV0Trigger);
+
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
mgr->StartAnalysis("local",chain,nev);
} else if (runMode == kMyRunModeCAF) {
mgr->StartAnalysis("proof",TString(data)+"#esdTree",nev);
- } else {
+ } else if (runMode == kMyRunModeGRID) {
+ mgr->StartAnalysis("grid");
+ }else {
cout << "ERROR: unknown run mode" << endl;
}
- if (doSave) MoveOutput(data, "");
+ if (doSave) MoveOutput(data, Form("_TrkCut_%d_V0BGCUT_%d",ntrackletsKine,rejectBGV0Trigger));
}
}
else
{
- cout << "Init in Local mode" << endl;
+ cout << "Init in Local or Grid mode" << endl;
gSystem->Load("libVMC");
gSystem->Load("libTree");