use trigger selection only for real data
[u/mrichter/AliRoot.git] / PWG1 / TRD / macros / AddTRDinfoGen.C
CommitLineData
1ee39b3a 1#if ! defined (__CINT__) || defined (__MAKECINT__)
3f19c2cd 2#include "AliLog.h"
1ee39b3a 3#include "AliAnalysisManager.h"
4#include "AliAnalysisDataContainer.h"
d4f4bb29 5#include "PWG1/TRD/AliTRDinfoGen.h"
6#include "PWG1/TRD/info/AliTRDeventInfo.h"
7#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
1ee39b3a 8#endif
9
d4f4bb29 10#include "PWG1/TRD/macros/helper.C"
1ee39b3a 11void AddTRDinfoGen(AliAnalysisManager *mgr, Char_t *trd, AliAnalysisDataContainer **/*ci*/, AliAnalysisDataContainer **co)
12{
13 Int_t map = ParseOptions(trd);
14 if(!(TSTBIT(map, kInfoGen))) return;
44b4e66d 15 Bool_t mc(mgr->GetMCtruthEventHandler()?kTRUE:kFALSE);
3d2a3dff 16 //AliLog::SetClassDebugLevel("AliTRDinfoGen", 2);
3f19c2cd 17 AliTRDinfoGen *info(NULL);
f2e89a4c 18 mgr->AddTask(info = new AliTRDinfoGen((char*)"genInfo"));
1ee39b3a 19 info->SetDebugLevel(0);
44b4e66d 20 info->SetMCdata(mc);
3d83da78 21
3f19c2cd 22 // settings for collisions
44b4e66d 23 info->SetCollision(kFALSE);
3f19c2cd 24 if(info->IsCollision()){
44b4e66d 25 if(mc) info->SetTrigger(
3f19c2cd 26 "CINT1B-ABCE-NOPF-ALL"
27 " CSCO1-ABCE-NOPF-CENT" // cosmic SPD trigger
28 );
29 info->SetLocalEvSelection();
30 info->SetLocalTrkSelection();
31 }
705f8b0a 32
33 // Connect IO slots
3d83da78 34 mgr->ConnectInput (info, 0, mgr->GetCommonInputContainer());
705f8b0a 35 co[kEventInfo] = mgr->CreateContainer("eventInfo", AliTRDeventInfo::Class(), AliAnalysisManager::kExchangeContainer);
36 co[kTracksBarrel] = mgr->CreateContainer("tracksBarrel", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
37 co[kTracksSA] = mgr->CreateContainer("tracksSA", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
38 co[kTracksKink] = mgr->CreateContainer("tracksKink", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
39 co[kV0List] = mgr->CreateContainer("v0List", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
40 for(Int_t ios(1);ios<kNOutSlots;ios++) mgr->ConnectOutput(info, ios, co[ios]);
1ee39b3a 41}
42