26 char *
kInDir =
"/Users/Gustavo/Work/data/134908/pass1";
32 char *
kXML =
"collection.xml";
56 if(kInputData ==
"ESD") kTreeName =
"esdTree" ;
57 else if(kInputData ==
"AOD") kTreeName =
"aodTree" ;
59 cout<<
"Wrong data type "<<kInputData<<endl;
67 AliLog::SetGlobalLogLevel(AliLog::kError);
75 AliAODHandler* aodoutHandler =
new AliAODHandler();
76 aodoutHandler->SetOutputFileName(
"outputAOD.root");
78 aodoutHandler->SetCreateNonStandardAOD();
81 mgr->SetOutputEventHandler(aodoutHandler);
85 if(kInputData ==
"ESD")
88 AliESDInputHandler *esdHandler =
new AliESDInputHandler();
89 mgr->SetInputEventHandler(esdHandler);
90 esdHandler->SetReadFriends(kFALSE);
91 cout<<
"ESD handler "<<mgr->GetInputEventHandler()<<endl;
93 if(kInputData ==
"AOD")
96 AliAODInputHandler *aodHandler =
new AliAODInputHandler();
97 mgr->SetInputEventHandler(aodHandler);
99 aodHandler->SetMergeEvents(kTRUE);
100 aodHandler->AddFriend(
"AliAOD.root");
103 cout<<
"AOD handler "<<mgr->GetInputEventHandler()<<endl;
112 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
113 AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
117 gROOT->LoadMacro(
"AddTaskPhysicsSelection.C");
118 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
121 gROOT->LoadMacro(
"$ALICE_PHYSICS/PWGPP/EMCAL/macros/AddTaskEMCALClusterize.C");
127 if(
kRun < 122195 || (
kRun > 126437 &&
kRun < 136851) || kMC) calibTT=kFALSE ;
133 Int_t minEseed = 100;
143 minEcell,minEseed,dTime,wTime,unfMinE,unfFrac,
144 calibEnergy,badMap,calibTime,nonlinear);
171 mgr->StartAnalysis(smode.Data(),chain);
173 cout <<
" Analysis ended sucessfully "<< endl ;
176 else cout <<
"Chain was not produced ! "<<endl;
205 gSystem->Load(
"libANALYSISalice");
206 gSystem->Load(
"libANALYSISalice");
211 gSystem->Load(
"libEMCALUtils");
212 gSystem->Load(
"libPWGPPEMCAL");
224 TProof::Open(
"proof://mgheata@lxb6046.cern.ch");
232 gProof->UploadPackage(
"STEERBase.par");
233 gProof->EnablePackage(
"STEERBase");
235 gProof->UploadPackage(
"ESD.par");
236 gProof->EnablePackage(
"ESD");
238 gProof->UploadPackage(
"AOD.par");
239 gProof->EnablePackage(
"AOD");
241 gProof->UploadPackage(
"ANALYSIS.par");
242 gProof->EnablePackage(
"ANALYSIS");
246 gProof->ShowEnabledPackages();
258 TString parpar(Form(
"%s.par", pararchivename)) ;
259 if (
gSystem->AccessPathName(parpar.Data()) ) {
261 TString processline(Form(
".! make %s", parpar.Data())) ;
262 gROOT->ProcessLine(processline.Data()) ;
263 gSystem->ChangeDirectory(cdir) ;
264 processline = Form(
".! mv $ALICE_PHYSICS/%s .", parpar.Data()) ;
265 gROOT->ProcessLine(processline.Data()) ;
267 if (
gSystem->AccessPathName(pararchivename) ) {
268 TString processline = Form(
".! tar xvzf %s",parpar.Data()) ;
269 gROOT->ProcessLine(processline.Data());
273 gSystem->ChangeDirectory(pararchivename);
276 if (!
gSystem->AccessPathName(
"PROOF-INF/BUILD.sh")) {
277 printf(
"*******************************\n");
278 printf(
"*** Building PAR archive ***\n");
279 cout<<pararchivename<<endl;
280 printf(
"*******************************\n");
282 if (
gSystem->Exec(
"PROOF-INF/BUILD.sh")) {
283 Error(
"runProcess",
"Cannot Build the PAR Archive! - Abort!");
288 if (!
gSystem->AccessPathName(
"PROOF-INF/SETUP.C")) {
289 printf(
"*******************************\n");
290 printf(
"*** Setup PAR archive ***\n");
291 cout<<pararchivename<<endl;
292 printf(
"*******************************\n");
293 gROOT->Macro(
"PROOF-INF/SETUP.C");
296 gSystem->ChangeDirectory(ocwd.Data());
297 printf(
"Current dir: %s\n", ocwd.Data());
311 gROOT->LoadMacro(
"$ALICE_PHYSICS/PWG/EMCAL/macros/CreateESDChain.C");
313 chain = CreateESDChain(
"ESD12001.txt", 5);
326 else cout<<
"INDIR not set, use default: "<<
kInDir<<endl;
330 else cout<<
"PATTERN not set, use default: "<<
kPattern<<endl;
334 else cout<<
"NFILES not set, use default: "<<
kFile<<endl;
338 printf(
"Get %d files from directory %s\n",
kFile,
kInDir);
340 printf(
"%s does not exist\n",
kInDir) ;
345 cout<<
"INDIR : "<<
kInDir<<endl;
346 cout<<
"NFILES : "<<
kFile<<endl;
347 cout<<
"PATTERN : " <<
kPattern<<endl;
350 if(kInputData ==
"ESD") datafile =
"AliESDs.root" ;
351 else if(kInputData ==
"AOD") datafile =
"AliAODs.root" ;
352 else if(kInputData ==
"MC") datafile =
"galice.root" ;
359 for (event = 0 ;
event <
kFile ;
event++) {
360 sprintf(file,
"%s/%s%d/%s",
kInDir,
kPattern,event,datafile.Data()) ;
363 if ( fESD = TFile::Open(file)) {
364 if ( fESD->Get(kTreeName) ) {
365 printf(
"++++ Adding %s\n", file) ;
366 chain->AddFile(file);
370 printf(
"---- Skipping %s\n", file) ;
374 printf(
"number of entries # %lld, skipped %d\n", chain->GetEntries(), skipped*100) ;
377 TString input =
"AliESDs.root" ;
378 cout<<
">>>>>> No list added, take a single file <<<<<<<<< "<<input<<endl;
379 chain->AddFile(input);
387 else if(mode ==
mGRID){
394 sprintf(
kXML,
"collection.xml") ;
396 if (!TFile::Open(
kXML)) {
397 printf(
"No collection file with name -- %s -- was found\n",
kXML);
400 else cout<<
"XML file "<<
kXML<<endl;
405 TGrid::Connect(
"alien://") ;
409 TGridCollection * collection = (TGridCollection*) TAlienCollection::Open(
kXML);
411 AliError(Form(
"%s not found",
kXML)) ;
414 TGridResult* result = collection->GetGridResult(
"",0 ,0);
417 printf(
"*** Getting the Chain ***\n");
418 for (
Int_t index = 0; index < result->GetEntries(); index++) {
419 TString alienURL = result->GetKey(index,
"turl") ;
420 cout <<
"================== " << alienURL << endl ;
421 chain->Add(alienURL) ;
425 gSystem->ChangeDirectory(ocwd.Data());
anaModes
Different analysis modes.
void CreateChain(const anaModes mode, TChain *chain)
void LoadLibraries(const anaModes mode)
void emcalReclusterize(Int_t mode=mLocal)
TFile * file
TList with histograms for a given trigger.
AliAnalysisTaskEMCALClusterize * AddTaskEMCALClusterize(const char *clusArrTit="EMCAL_Clusters_New", const Bool_t bFillAOD=kFALSE, const Int_t bMC=kFALSE, const Bool_t exotic=kTRUE, const TString name="V1Unfold", const TString trigger="", const Int_t tm=1, const Int_t minEcell=50, const Int_t minEseed=100, const Int_t maxDeltaT=250, const Int_t timeWindow=1000, const Int_t minEUnf=15, const Int_t minFrac=1, const Bool_t bRecalE=kTRUE, const Bool_t bBad=kTRUE, const Bool_t bRecalT=kTRUE, const Bool_t bNonLine=kFALSE, const Int_t minCen=-1, const Int_t maxCen=-1, const Float_t clusterEnergyCutEvent=-1, const Int_t nRowDiff=1, const Int_t nColDiff=1, const Bool_t skipOrReject=kFALSE, const Int_t tCardMimic=0, const Bool_t cellUpd=kTRUE)
void SetupPar(char *pararchivename)
Reclusterize EMCal clusters, put them in a new branch for other following analysis.