From b21a4af61f9dfd5241592057e8c82c251d519b56 Mon Sep 17 00:00:00 2001 From: kread Date: Fri, 25 Sep 2009 17:58:56 +0000 Subject: [PATCH] New PWG4 electron-jet analysis macros and goodies --- .../macros/electrons/ConfigAnalysisElectron.C | 128 ++-- .../electrons/ConfigJetAnalysisFastJet.C | 91 +++ PWG4/macros/electrons/README | 65 +- PWG4/macros/electrons/ReadAODJete.C | 99 +++ PWG4/macros/electrons/anaJete.C | 663 ++++++++++++++++++ PWG4/macros/electrons/anaJete.jdl | 41 ++ PWG4/macros/electrons/anaJete.sh | 19 + PWG4/macros/electrons/mergeElectron.jdl | 12 - PWG4/macros/electrons/mergeout.jdl | 8 + PWG4/macros/electrons/mergeoutscaled.jdl | 8 + PWG4/macros/electrons/mylauncher.C | 8 +- PWG4/macros/electrons/myplot11.C | 15 + PWG4/macros/electrons/myplot11s.C | 15 + PWG4/macros/electrons/parmaker | 58 +- 14 files changed, 1075 insertions(+), 155 deletions(-) create mode 100755 PWG4/macros/electrons/ConfigJetAnalysisFastJet.C create mode 100755 PWG4/macros/electrons/ReadAODJete.C create mode 100755 PWG4/macros/electrons/anaJete.C create mode 100644 PWG4/macros/electrons/anaJete.jdl create mode 100755 PWG4/macros/electrons/anaJete.sh delete mode 100644 PWG4/macros/electrons/mergeElectron.jdl create mode 100644 PWG4/macros/electrons/mergeout.jdl create mode 100644 PWG4/macros/electrons/mergeoutscaled.jdl create mode 100644 PWG4/macros/electrons/myplot11.C create mode 100644 PWG4/macros/electrons/myplot11s.C diff --git a/PWG4/macros/electrons/ConfigAnalysisElectron.C b/PWG4/macros/electrons/ConfigAnalysisElectron.C index 1925cf6f891..8346b9ff18f 100644 --- a/PWG4/macros/electrons/ConfigAnalysisElectron.C +++ b/PWG4/macros/electrons/ConfigAnalysisElectron.C @@ -1,10 +1,9 @@ -/* $Id: $ */ -/* $Log$ */ - //------------------------------------ // Configuration macro example: // -// Do EMCal electron analysis with ESDs +// Configure EMCal electron analysis +// +// Modified by: K. Read // //------------------------------------ @@ -16,74 +15,72 @@ AliAnaPartCorrMaker* ConfigAnalysis() printf("======================== \n"); printf("ConfigAnalysisElectron() \n"); printf("======================== \n"); - - + Bool_t kInputIsESD = kTRUE; //uncomment for input ESD +//Bool_t kInputIsESD = kFALSE; //uncomment for input AODs + Bool_t kFollowsFilter = kTRUE; //uncomment if follows ESD filter task +//Bool_t kFollowsFilter = kFALSE; //uncomment if no ESD filter task + //Detector Fidutial Cuts AliFidutialCut * fidCut = new AliFidutialCut(); fidCut->DoCTSFidutialCut(kFALSE) ; fidCut->DoEMCALFidutialCut(kFALSE) ; fidCut->DoPHOSFidutialCut(kFALSE) ; - + //fidCut->SetSimpleCTSFidutialCut(0.9,0.,360.); //fidCut->SetSimpleEMCALFidutialCut(0.7,80.,190.); //fidCut->SetSimplePHOSFidutialCut(0.13,220.,320.); - + fidCut->Print(""); - - + //----------------------------------------------------------- // Reader //----------------------------------------------------------- - //AliCaloTrackAODReader *reader = new AliCaloTrackAODReader(); - AliCaloTrackESDReader *reader = new AliCaloTrackESDReader(); + if(kInputIsESD && !kFollowsFilter)AliCaloTrackESDReader *reader = new AliCaloTrackESDReader(); + else AliCaloTrackAODReader *reader = new AliCaloTrackAODReader(); reader->SetDebug(-1);//10 for lots of messages - + //Switch on or off the detectors information that you want - reader->SwitchOnCTS(); reader->SwitchOnEMCAL(); + reader->SwitchOnCTS(); + //reader->SwitchOffEMCALCells(); reader->SwitchOffPHOS(); - + //reader->SwitchOffPHOSCells(); + //Kine - //reader->SwitchOffStack(); // On by default, remember to SwitchOnMCData() in analysis classes - //reader->SwitchOnAODMCParticles(); // Off by default, remember to SwitchOnMCData() in analysis classes + if(!kInputIsESD){ + reader->SwitchOffStack(); // On by default, remember to SwitchOnMCData() in analysis classes + reader->SwitchOnAODMCParticles(); // Off by default, remember to SwitchOnMCData() in analysis classes + } //Min particle pT - reader->SetEMCALPtMin(1.); - - //In case of generating jet events (with PYTHIA), if pt hard - //bin is small reject events with large difference between - //ptHard and triggered jet + reader->SetCTSPtMin(0.0); //new + reader->SetEMCALPtMin(0.0); //new + if(kFollowsFilter)reader->SetTrackStatus(0); //to prevent automatic TPC and ITS refit + + //In case of generating jet events (with PYTHIA), if pt hard bin is small + //reject events with large difference between ptHard and triggered jet //reader->SetPtHardAndJetPtComparison(kTRUE); - + reader->SetFidutialCut(fidCut); - - //Embedding/mixing/merging analysis with other events in - //another AOD file - //reader->SetSecondInputFileName("./aod.root"); - //Standard event loop can have less events, start mixing at - //event N - //reader->SetSecondInputFirstEvent(0); - - // Analysis with tracks, select only tracks with - // following bits - - //We want tracks fitted in the detectors: - // ULong_t status=AliAODTrack::kTPCrefit; - // status|=AliAODTrack::kITSrefit; - - //We want tracks whose PID bit is set: - // ULong_t status =AliAODTrack::kITSpid; - // status|=AliAODTrack::kTPCpid; - - // reader->SetTrackStatus(status); - + + if(!kInputIsESD){ + // Analysis with tracks, select only tracks with + // following bits + + // //We want tracks fitted in the detectors: + // ULong_t status=AliAODTrack::kTPCrefit; + // status|=AliAODTrack::kITSrefit; + + // We want tracks whose PID bit is set: + // ULong_t status =AliAODTrack::kITSpid; + // status|=AliAODTrack::kTPCpid; + + // reader->SetTrackStatus(status); + } + reader->Print(""); - - - //--------------------------------------------------------------------- - // Analysis algorithm - //--------------------------------------------------------------------- - + + //Detector Fidutial Cuts AliFidutialCut * fidCut2 = new AliFidutialCut(); fidCut2->DoEMCALFidutialCut(kTRUE) ; @@ -94,34 +91,29 @@ AliAnaPartCorrMaker* ConfigAnalysis() fidCut2->Print(""); + //--------------------------------------------------------------------- + // Analysis algorithm + //--------------------------------------------------------------------- + AliAnaElectron *anaelectron = new AliAnaElectron(); anaelectron->SetDebug(-1); //10 for lots of messages anaelectron->SetCalorimeter("EMCAL"); - anaelectron->SetWriteNtuple(kTRUE); - //matching cuts + anaelectron->SwitchOnDataMC(); anaelectron->SetpOverEmin(0.8); anaelectron->SetpOverEmax(1.2); anaelectron->SetResidualCut(0.05); - //B-tagging cuts - anaelectron->SetDrCut(1.0); - anaelectron->SetPairDcaCut(0.02); - anaelectron->SetDecayLenCut(1.0); - anaelectron->SetImpactCut(0.5); - anaelectron->SetAssocPtCut(1.0); - anaelectron->SetMassCut(1.5); - anaelectron->SetSdcaCut(0.1); - anaelectron->SetITSCut(4); - - anaelectron->SwitchOnDataMC(); //Access MC stack and fill more histograms anaelectron->SetMinPt(1.); + anaelectron->SetImpactCut(1.0); //instead of 0.5 + anaelectron->SetSdcaCut(0.05); //instead of 0.1 anaelectron->SetOutputAODName("Electrons"); anaelectron->SetOutputAODClassName("AliAODPWG4Particle"); + anaelectron->SetWriteNtuple(kFALSE); //Set Histrograms bins and ranges anaelectron->SetHistoPtRangeAndNBins(0, 50, 100) ; anaelectron->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ; - anaelectron->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; + anaelectron->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; anaelectron->Print(""); - + //--------------------------------------------------------------------- // Set analysis algorithm and reader //--------------------------------------------------------------------- @@ -131,11 +123,11 @@ AliAnaPartCorrMaker* ConfigAnalysis() maker->SetAnaDebug(-1) ; maker->SwitchOnHistogramsMaker() ; maker->SwitchOnAODsMaker() ; - + maker->Print(""); // - printf("======================== \n"); + printf("============================ \n"); printf("END ConfigAnalysisElectron() \n"); - printf("======================== \n"); + printf("============================ \n"); return maker ; } diff --git a/PWG4/macros/electrons/ConfigJetAnalysisFastJet.C b/PWG4/macros/electrons/ConfigJetAnalysisFastJet.C new file mode 100755 index 00000000000..8ab5dd482b2 --- /dev/null +++ b/PWG4/macros/electrons/ConfigJetAnalysisFastJet.C @@ -0,0 +1,91 @@ +//------------------------------------ +// Configuration macro: +// +// Configure JETAN FastJet analysis. +// +// Modified by: K. Read +// +//------------------------------------ + +AliJetFinder* ConfigJetAnalysis() +{ + // + // Configuration goes here + // + printf("========================== \n"); + printf("ConfigJetAnalysisFastJet() \n"); + printf("========================== \n"); + + Bool_t kInputIsESD = kTRUE; //uncomment for input ESD + //Bool_t kInputIsESD = kFALSE; //uncomment for input AODs + Bool_t kFollowsFilter = kTRUE; //uncomment if follows ESD filter task + //Bool_t kFollowsFilter = kFALSE; //uncomment if no ESD filter task + + + // Define the grids + AliJetGrid *grid = new AliJetGrid(419,119,0.,2*TMath::Pi(),-0.9,0.9); + grid->SetGridType(1); + grid->InitParams(80.*TMath::Pi()/180,190.*TMath::Pi()/180,-0.7,0.7); + grid->SetMatrixIndexes(); + grid->SetIndexIJ(); + AliJetGrid *grid2 = new AliJetGrid(131,95,80.*TMath::Pi()/180.,190.*TMath::Pi()/180.,-0.7,0.7); + grid2->SetGridType(0); + grid2->SetMatrixIndexes(); + grid2->SetIndexIJ(); + + // Define reader header + if(kInputIsESD && !kFollowsFilter) AliJetESDReaderHeader *jrh = new AliJetESDReaderHeader(); + else AliJetAODReaderHeader *jrh = new AliJetAODReaderHeader(); + jrh->SetComment("Testing"); + if(kInputIsESD && !kFollowsFilter) jrh->SetReadSignalOnly(kFALSE); + + // Detector options: 0 = Charged particles only (MomentumArray) + // 1 = Charged particles only (UnitArray) + // 2 = Neutral cells only (UnitArray) + // 3 = Charged particles + neutral cells (UnitArray) + jrh->SetDetector(3); + //jrh->SetDebug(-1); + //jrh->SetFiducialEta(-0.7,0.7); + //jrh->SetFiducialPhi(80.*TMath::Pi()/180,190.*TMath::Pi()/180); + jrh->SetPtCut(0.1); + jrh->SetFiducialEta(-0.9,0.9); //fiducial range used by AliJetFillUnitArrayTracks + jrh->SetFiducialPhi(0,2*TMath::Pi()); //fiducial range used by AliJetFillUnitArrayTracks + + // Define reader and set its header + if(kInputIsESD && !kFollowsFilter) AliJetESDReader *er = new AliJetESDReader(); + else AliJetAODReader *er = new AliJetAODReader(); + er->SetReaderHeader(jrh); + er->SetTPCGrid(grid); + er->SetEMCalGrid(grid2); + er->SetApplyMIPCorrection(kFALSE); + + // Define jet header + AliFastJetHeaderV1 *jh=new AliFastJetHeaderV1(); + Double_t R=0.4; + Double_t Rbkg=0.2; + + // AliFastJetHeaderV1 *jh=new AliFastJetHeaderV1(); + jh->SetComment("Fast jet code with default parameters"); + //jh->SetDebug(-1); + //jh->SetBGMode(1); //Do BG Subtraction + jh->SetBGMode(0); //No BG Subtraction. Store AOD track refs. + jh->SetRparam(R); // setup parameters + jh->SetRparamBkg(Rbkg); // setup parameters + jh->SetPtMin(0.2); + //jh->SetGhostEtaMax(0.9); + jh->SetGhostArea(0.01); + jh->SetGhostEtaMax(0.7);//used to set the rap_min and rap_max, that are then used by FJ + jh->SetPhiRange(80.*TMath::Pi()/180+R,190.*TMath::Pi()/180-R);//used in AliFastJetFinder for the range + + // Define jet finder. Set its header and reader + jetFinder = new AliFastJetFinder(); + jetFinder->SetJetHeader(jh); + jetFinder->SetJetReader(er); + //jetFinder->SetPlotMode(kTRUE); + + printf("============================== \n"); + printf("END ConfigJetAnalysisFastJet() \n"); + printf("============================== \n"); + + return jetFinder; +} diff --git a/PWG4/macros/electrons/README b/PWG4/macros/electrons/README index f60037eb5fb..2a8266514af 100644 --- a/PWG4/macros/electrons/README +++ b/PWG4/macros/electrons/README @@ -1,64 +1,3 @@ -This example performs a JETAN FastJet analysis and an electron analysis. - -Copy this subdirectory and its subdirectories in AFS to your local -laptop work directory. Replace "kread" with your username in all of -the files in this example. Be sure to replace my email address with -yours in mergeout.jdl . - -To execute this example create a subdirectory in AliEn called -$HOME/work12. Then from your laptop work directory, type: - -root -q -b -l mylauncher.C - -That will do a robust file upload and submit the job. If you need to -submit the job again, just do this: - -aliensh -cd ~/work12 -submit anaJete.jdl - -Later, merge via: - -submit mergeout.jdl - - -The example is set for input (production) ESDs. -To adjust for an input AOD instead: -1. Adjust INDIR and PATTERN in anaJete.sh to point to an AOD directory. -2. Change kInputData to "AOD" in anaJete.C -4. Change kInputIsESD to kFALSE in ConfigJetAnalysisFastJet.C. -3. Change kInputIsESD to kFALSE in ConfigAnalysisElectron.C. -4. Change kFollowsFilter to kFALSE in ConfigJetAnalysisFastJet.C. -5. Change kFollowsFilter to kFALSE in ConfigAnalysisElectron.C. - -[6. In order to merge two input AODs, do these 5 steps above and change - kMergeAODs to kTRUE in anaJete.C.] - - -To run locally, just type "anaJete.sh". - -The present PAR files are ready to go. They contain a few necessary -but unofficial patches relative to AliRoot trunk (which are also -available in the provided patch subdirectory tree). This is -temporary. If you need to make new PAR files, from your work -directory type: - -parmaker4 PWG4PartCorrBase remote patch -parmaker4 PWG4PartCorrDep remote patch -parmaker4 JETAN remote patch -parmaker4 FASTJETAN remote patch - -Note that parmaker4 can build good PAR files immediately after the svn -checkout of AliRoot. It does not depend on doing $ALICE_ROOT/make . - - - -***************************************************** - -DETAILS: - -Even though cgal and boost are invoked by the JDL, they do not -actually appear in the JDL. The PackMan AliEn package facility will -indeed properly load the external fastjet package and its dependencies -using the JDL in this example. +Documentation of these macros and goodies is provided at: +http://aliceinfo.cern.ch/Offline/Activities/Analysis/PWGDocumentation/PWG4/ElectronMacros.html diff --git a/PWG4/macros/electrons/ReadAODJete.C b/PWG4/macros/electrons/ReadAODJete.C new file mode 100755 index 00000000000..88ada327f8b --- /dev/null +++ b/PWG4/macros/electrons/ReadAODJete.C @@ -0,0 +1,99 @@ +void ReadAODJete(){ + gSystem->Load("libTree.so"); + gSystem->Load("libPhysics.so"); + gSystem->Load("libGeom.so"); + gSystem->Load("libVMC.so"); + gSystem->Load("libCGAL"); + gSystem->Load("libfastjet"); + gSystem->Load("libSISConePlugin"); + gSystem->Load("libSTEERBase"); + gSystem->Load("libESD"); + gSystem->Load("libAOD"); + gSystem->Load("libANALYSIS"); + gSystem->Load("libANALYSISalice"); + gSystem->Load("libJETAN"); + gSystem->Load("libFASTJETAN"); + gSystem->Load("libPWG4PartCorrBase"); + gSystem->Load("libPWG4PartCorrDep"); + + + TFile* fin=new TFile("aodoutput.root"); + + TTree *aodTree = (TTree*)fin->Get("aodTree"); + AliAODEvent *ev = new AliAODEvent(); + ev->ReadFromTree(aodTree); + Int_t nEvents = aodTree->GetEntries(); + cout<GetUserInfo()->FindObject("AliJetHeader_jets"); + cout<<"Rparam = "<GetRparam()<<" BGmode = "<GetBGMode()<GetEvent(nEv); + + //getting jets + Int_t nJets = ev->GetNJets(); + for(Int_t iJet=0; iJetGetJet(iJet); + cout<Pt()<Print(); + cout<<"*****************************END JET PRINTOUT**************************"<FindListObject("jeteventbackground"); + + cout<<"*******************************evBkg = "<Print(); + + Float_t bkg1=evBkg->GetBackground(0); + Float_t bkg2=evBkg->GetBackground(1); + Float_t bkg3=evBkg->GetBackground(2); + Float_t bkg4=evBkg->GetBackground(3); + + cout<<"ev = "<Fill(bkg1); + h2->Fill(bkg2); + h3->Fill(bkg3); + h4->Fill(bkg4); + } + + } + h1->GetXaxis()->SetTitle("#rho"); + h2->GetXaxis()->SetTitle("#rho"); + h3->GetXaxis()->SetTitle("#rho"); + h4->GetXaxis()->SetTitle("#rho"); + h1->GetYaxis()->SetTitle("Entries"); + h2->GetYaxis()->SetTitle("Entries"); + h3->GetYaxis()->SetTitle("Entries"); + h4->GetYaxis()->SetTitle("Entries"); + + h1->SetTitle("FastJet R=0.2 All"); + h2->SetTitle("FastJet R=0.4 Charged"); + h3->SetTitle("Out-of-cone"); + h4->SetTitle("Out-of-jet"); + + + TCanvas* c1=new TCanvas(); + c1->Divide(2,2); + c1->cd(1); + h1->Draw(); + c1->cd(2); + h2->Draw(); + c1->cd(3); + h3->Draw(); + c1->cd(4); + h4->Draw(); + +} diff --git a/PWG4/macros/electrons/anaJete.C b/PWG4/macros/electrons/anaJete.C new file mode 100755 index 00000000000..765134e6283 --- /dev/null +++ b/PWG4/macros/electrons/anaJete.C @@ -0,0 +1,663 @@ +/* $Id: $ */ +//-------------------------------------------------- +// Example macro to do multi-platform JETAN/FASTJET analysis +// Can be executed with Root and AliRoot +// +// Configured by options and definitions set in the lines below and +// additional external configuration files and environement variables. +// +// Author: K. Read +// +//------------------------------------------------- +enum anaModes {mLocal, mLocalCAF, mPROOF, mGRID, mPLUGIN}; +//mLocal = 0: Analyze locally files in your computer +//mLocalCAF = 1: Analyze locally CAF files +//mPROOF = 2: Analyze CAF files with PROOF +//mGRID = 3: Analyze files on GRID +//mPLUGIN = 4: Analyze files on GRID with AliEn plugin + +//--------------------------------------------------------------------------- +//Settings to read locally several files, only for "mLocal" mode +//The different values are default, they can be set with environmental +//variables: INDIR, PATTERN, NFILES, respectively +//char * kInDir = "/afs/cern.ch/user/k/kread/public/data/"; +char * kInDir = "/user/data/files"; +char * kPattern = ""; // Data are in files kInDir/kPattern+i +Int_t kFile = 1; // Number of files +//--------------------------------------------------------------------------- +//Collection file for grid analysis +char * kXML = "collection.xml"; +//--------------------------------------------------------------------------- +//Data directory for PROOF analysis +char * kmydataset = "/COMMON/COMMON/LHC09a4_run8101X"; +//char * kmydataset = "/PWG4/mcosenti/LHC08d10_ppElectronB_Jets#esdTree"; +//--------------------------------------------------------------------------- +//Scale histograms from file. Change to kTRUE when xsection file exists +//Put name of file containing xsection +//Put number of events per ESD file +//This is an specific case for normalization of Pythia files. +const Bool_t kGetXSectionFromFileAndScale = kTRUE ; +const char * kXSFileName = "pyxsec.root"; +const Int_t kNumberOfEventsPerFile = 200; +//--------------------------------------------------------------------------- + +const Bool_t kMC = kTRUE; //With real data kMC = kFALSE +const TString kInputData = "ESD";//ESD, AOD, MC +TString kTreeName = "esdTree"; +//const Bool_t kMergeAODs = kTRUE; //uncomment for AOD merging +const Bool_t kMergeAODs = kFALSE; //uncomment for no AOD merging +Int_t sevent = 0; + +Int_t mode = mLocal; +char sconfig1[1024] = "ConfigPWG4AODtoAOD"; //"ConfigAnalysis"; +char sconfig2[1024] = "ConfigJetAnalysisFastJet.C";//"ConfigAnalysis"; +char sconfig3[1024] = "ConfigAnalysisElectron"; //"ConfigAnalysis"; + +void anaJete() +{ + // Main + + //Process environmental variables from command line: + ProcessEnvironment(); + printf("Final Variables: mode %d, config1 %s, config2 %s, config3 %s, sevent %d\n", mode,sconfig1,sconfig2,sconfig3,sevent); + + //-------------------------------------------------------------------- + // Load analysis libraries + // Look at the method below, + // change whatever you need for your analysis case + // ------------------------------------------------------------------ + LoadLibraries(mode) ; + + //------------------------------------------------------------------------------------------------- + //Create chain from ESD and from cross sections files, look below for options. + //------------------------------------------------------------------------------------------------- + if(kInputData == "ESD") kTreeName = "esdTree" ; + else if(kInputData == "AOD") kTreeName = "aodTree" ; + else if (kInputData == "MC") kTreeName = "TE" ; + else { + cout<<"Wrong data type "<SetRunMode("submit"); + //Uncomment the following 3 lines to permit auto xml creation + //plugin->SetGridDataDir("/alice/sim/PDC_08b/LHC08d10/"); //dummy + //plugin->SetDataPattern("AliESDs.root"); //dummy + //plugin->AddRunNumber(30010); //dummy + plugin->AddDataFile("mycollect.xml"); + plugin->SetGridWorkingDir("work3"); + plugin->SetAdditionalLibs("anaJet.C ConfigJetAnalysisFastJet.C ConfigAnalysisElectron.C ANALYSIS.par ANALYSISalice.par AOD.par ESD.par STEERBase.par JETAN.par FASTJETAN.par"); + plugin->SetJDLName("anaJet.jdl"); + plugin->SetExecutable("anaJet.sh"); + plugin->SetOutputFiles("histos.root"); + AliAnalysisGrid *alienHandler = plugin; + if (!alienHandler) return; + + // Connect plug-in to the analysis manager + mgr->SetGridHandler(alienHandler); + } + + // MC handler + if(kMC || kInputData == "MC"){ + AliMCEventHandler* mcHandler = new AliMCEventHandler(); + mcHandler->SetReadTR(kFALSE);//Do not search TrackRef file + mgr->SetMCtruthEventHandler(mcHandler); + if( kInputData == "MC") mgr->SetInputEventHandler(NULL); + } + + // AOD output handler + AliAODHandler* aodoutHandler = new AliAODHandler(); + aodoutHandler->SetOutputFileName("aodoutput.root"); + if(kMergeAODs)aodoutHandler->SetCreateNonStandardAOD(); + mgr->SetOutputEventHandler(aodoutHandler); + + //input + if(kInputData == "ESD"){ + // ESD handler + AliESDInputHandler *esdHandler = new AliESDInputHandler(); + mgr->SetInputEventHandler(esdHandler); + } + if(kInputData == "AOD"){ + // AOD handler + AliAODInputHandler *aodHandler = new AliAODInputHandler(); + mgr->SetInputEventHandler(aodHandler); + if(kMergeAODs){ + char path[1024]; + sprintf(path,"AliAOD.root"); + if(gSystem->Getenv("SIMPATH")) + sprintf(path,"%s/AliAOD.root",gSystem->Getenv("SIMPATH")); + cout<<"Config: Second input file: "<SetMergeEvents(kTRUE); + aodHandler->AddFriend(path); + cout<<"Config: Starting event for second input file: "<SetMergeOffset(sevent); + } + } + + mgr->SetDebugLevel(3); // For debugging, do not uncomment if you want no messages. + + + const Bool_t kDoESDFilter = kTRUE; //need this for JETAN with input ESDs + //const Bool_t kDoESDFilter = kFALSE; + if(kInputData == "ESD" && kDoESDFilter){ + printf("Applying ESD filter cuts appropriate for jet analysis\n"); + // + // Set of cuts + // + // standard + AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Loose"); + //esdTrackCutsL->SetMinNClustersTPC(50); + //esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5); + //esdTrackCutsL->SetMaxCovDiagonalElements(2,2,0.5,0.5,2); + //esdTrackCutsL->SetRequireTPCRefit(kTRUE); + //esdTrackCutsL->SetMinNsigmaToVertex(3); //keep commented out + //esdTrackCutsL->SetRequireSigmaToVertex(kTRUE); //keep commented out + //esdTrackCutsL->SetAcceptKinkDaughters(kFALSE); + // + // hard + AliESDtrackCuts* esdTrackCutsH = new AliESDtrackCuts("AliESDtrackCuts", "Hard"); + esdTrackCutsH->SetMinNClustersTPC(100); + esdTrackCutsH->SetMaxChi2PerClusterTPC(2.0); + esdTrackCutsH->SetMaxCovDiagonalElements(2,2,0.5,0.5,2); + esdTrackCutsH->SetRequireTPCRefit(kTRUE); + //esdTrackCutsH->SetMinNsigmaToVertex(2); + //esdTrackCutsH->SetRequireSigmaToVertex(kTRUE); + esdTrackCutsH->SetAcceptKinkDaughters(kFALSE); + // + AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter"); + trackFilter->AddCuts(esdTrackCutsL); + // trackFilter->AddCuts(esdTrackCutsH); + // + AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter"); + esdfilter->SetTrackFilter(trackFilter); + esdfilter->SetDebugLevel(10); + mgr->AddTask(esdfilter); + } + + + //------------------------------------------------------------------------- + //Define task, put here any other task that you want to use. + //------------------------------------------------------------------------- + + // + // Jet analysis + // + AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis",chain); + jetana->SetDebugLevel(2); + jetana->SetConfigFile(sconfig2); //Default ConfigJetAnalysisFastJet + //Uncommenting the following line produces too many AddAtAndExpand warnings for now. + if(kMergeAODs)jetana->ReadAODFromOutput(); //Uncomment when AOD merging + mgr->AddTask(jetana); + + // + // electron analysis + // + AliAnalysisTaskParticleCorrelation * taskpwg4 = new AliAnalysisTaskParticleCorrelation ("Particle"); + taskpwg4->SetConfigFileName("ConfigAnalysisElectron"); //Default name is ConfigAnalysisElectron + mgr->AddTask(taskpwg4); + + // Create containers for input/output + AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); + AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer(); + AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("histos", TList::Class(), + AliAnalysisManager::kOutputContainer, "histos.root"); + + + if(kInputData == "ESD" && kDoESDFilter){ + mgr->ConnectInput (esdfilter, 0, cinput1 ); + mgr->ConnectOutput (esdfilter, 0, coutput1 ); + } + + mgr->ConnectInput (jetana, 0, cinput1 ); + mgr->ConnectOutput (jetana, 0, coutput1 ); + mgr->ConnectOutput (jetana, 1, coutput2 ); + + mgr->ConnectInput (taskpwg4, 0, cinput1 ); + mgr->ConnectOutput (taskpwg4, 0, coutput1 ); + mgr->ConnectOutput (taskpwg4, 1, coutput2 ); + + + //------------------------ + //Scaling task + //----------------------- + Int_t nfiles = chainxs->GetEntries(); + Int_t nevents = chain->GetEntries(); + cout<<"Get? "< 0){ + //cout<<"Init AnaScale"<Set(xsection/ntrials/nevents) ; + scale->MakeSumw2(kTRUE);//If you want histograms with error bars set to kTRUE + scale->SetDebugLevel(2); + mgr->AddTask(scale); + + AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("histosscaled", TList::Class(), + AliAnalysisManager::kOutputContainer, "histosscaled.root"); + mgr->ConnectInput (scale, 0, coutput2); + mgr->ConnectOutput (scale, 0, coutput3 ); + } + + //----------------------- + // Run the analysis + //----------------------- + TString smode = ""; + if (mode==mLocal || mode == mLocalCAF) + smode = "local"; + else if (mode==mPROOF) + smode = "proof"; + else if (mode==mGRID) + smode = "local"; + else if (mode==mPLUGIN) + smode = "grid"; + + //mgr->ResetAnalysis(); + mgr->InitAnalysis(); + mgr->PrintStatus(); + if (mode==mPROOF) + mgr->StartAnalysis(smode.Data(),kmydataset,1500,0); + else if (mode==mPLUGIN) + mgr->StartAnalysis(smode.Data()); + else + mgr->StartAnalysis(smode.Data(),chain,20); + + cout <<" Analysis ended sucessfully "<< endl ; + + } + else cout << "Chain was not produced ! "<>>>>>>>>>> Local mode <<<<<<<<<<<<<< + //---------------------------------------------------------- + if (mode==mLocal || mode == mLocalCAF || mode == mGRID || mode == mPLUGIN) { + bool usepar = true; + + //-------------------------------------- + // Load the needed libraries most of them already loaded by aliroot + //-------------------------------------- + gSystem->Load("libTree.so"); + gSystem->Load("libGeom.so"); + gSystem->Load("libVMC.so"); + gSystem->Load("libXMLIO.so"); + gSystem->Load("libCGAL"); + gSystem->Load("libfastjet"); + gSystem->Load("libSISConePlugin"); + + if(usepar){ + //-------------------------------------------------------- + //If you want to use root and par files from aliroot + //-------------------------------------------------------- + SetupPar("STEERBase"); + SetupPar("ESD"); + SetupPar("AOD"); + SetupPar("ANALYSIS"); + SetupPar("ANALYSISalice"); + cerr<<"Now Loading JETAN"<Load("libSTEERBase"); + gSystem->Load("libESD"); + gSystem->Load("libAOD"); + gSystem->Load("libANALYSIS"); + gSystem->Load("libANALYSISalice"); + gSystem->Load("libJETAN"); + gSystem->Load("libFASTJETAN"); + gSystem->Load("libPWG4PartCorrBase"); + gSystem->Load("libPWG4PartCorrDep"); + } + + + } + + //--------------------------------------------------------- + // <<<<<<<<<< PROOF mode >>>>>>>>>>>> + //--------------------------------------------------------- + else if (mode==mPROOF) { + // + // Connect to proof + // Put appropriate username here + // char* myproofname = "alicecaf"; + char* myproofname = "kread@localhost"; + + //TProof::Reset("proof://kread@lxb6046.cern.ch"); + //TProof::Reset("proof://myproofname); + //TProof::Reset("myproofname",kTRUE); + gEnv->SetValue("XSec.GSI.DelegProxy","2"); + //TProof::Mgr(myproofname)->ShowROOTVersions(); + //TProof::Mgr(myproofname)->SetROOTVersion("v5-23-04"); + TProof::Open(myproofname); + + // gProof->ClearPackages(); + // gProof->SetLogLevel(5); + // gProof->ClearPackage("STEERBase"); + // gProof->ClearPackage("ESD"); + // gProof->ClearPackage("AOD"); + // gProof->ClearPackage("ANALYSIS"); + // gProof->ClearPackage("ANALYSISalice"); + // gProof->ClearPackage("JETAN"); + // gProof->ClearPackage("FASTJETAN"); + // gProof->ShowEnabledPackages(); + + // Enable the STEERBase Package + gProof->UploadPackage("STEERBase.par"); + gProof->EnablePackage("STEERBase"); + // Enable the ESD Package + gProof->UploadPackage("ESD.par"); + gProof->EnablePackage("ESD"); + // Enable the AOD Package + gProof->UploadPackage("AOD.par"); + gProof->EnablePackage("AOD"); + // Enable the Analysis Package + gProof->UploadPackage("ANALYSIS.par"); + gProof->EnablePackage("ANALYSIS"); + // Enable the Analysis Package + gProof->UploadPackage("ANALYSISalice.par"); + gProof->EnablePackage("ANALYSISalice"); + // Enable JETAN analysis + gProof->UploadPackage("JETAN.par"); + gProof->EnablePackage("JETAN"); + // Enable FASTJETAN analysis + gProof->UploadPackage("FASTJETAN.par"); + gProof->EnablePackage("FASTJETAN"); + + gProof->ShowEnabledPackages(); + } + +} + +void SetupPar(char* pararchivename) +{ + //Load par files, create analysis libraries + //For testing, if par file already decompressed and modified + //classes then do not decompress. + + TString cdir(Form("%s", gSystem->WorkingDirectory() )) ; + TString parpar(Form("%s.par", pararchivename)) ; + if ( gSystem->AccessPathName(pararchivename) ) { + TString processline = Form(".! tar xvzf %s",parpar.Data()) ; + gROOT->ProcessLine(processline.Data()); + } + + TString ocwd = gSystem->WorkingDirectory(); + gSystem->ChangeDirectory(pararchivename); + + // check for BUILD.sh and execute + if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) { + printf("*******************************\n"); + printf("*** Building PAR archive ***\n"); + cout<Exec("PROOF-INF/BUILD.sh")) { + Error("runProcess","Cannot Build the PAR Archive! - Abort!"); + return -1; + } + } + // check for SETUP.C and execute + if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) { + printf("*******************************\n"); + printf("*** Setup PAR archive ***\n"); + cout<Macro("PROOF-INF/SETUP.C"); + } + + gSystem->ChangeDirectory(ocwd.Data()); + printf("Current dir: %s\n", ocwd.Data()); +} + + + +void CreateChain(const anaModes mode, TChain * chain, TChain * chainxs){ + //Fills chain with data + TString ocwd = gSystem->WorkingDirectory(); + + //----------------------------------------------------------- + //Analysis of CAF data locally + //----------------------------------------------------------- + if(mode == mLocalCAF){ + // Read the input list of files and add them to the chain + TString line; + ifstream in; + in.open("ESDlist.txt"); + while (in.good()) { + in >> line; + if (line.Length() == 0) continue; + // cout << " line = " << line << endl; + chain->Add(line); + } + } + + //--------------------------------------- + //Local files analysis + //--------------------------------------- + else if(mode == mLocal){ + //If you want to add several ESD files sitting in a common directory INDIR + //Specify as environmental variables the directory (INDIR), the number of files + //to analyze (NFILES) and the pattern name of the directories with files (PATTERN) + + if(gSystem->Getenv("INDIR")) + kInDir = gSystem->Getenv("INDIR") ; + else cout<<"INDIR not set, use default: "<Getenv("PATTERN")) + kPattern = gSystem->Getenv("PATTERN") ; + else cout<<"PATTERN not set, use default: "<Getenv("NFILES")) + kFile = atoi(gSystem->Getenv("NFILES")) ; + else cout<<"NFILES not set, use default: "<cd(kInDir) ) {//check if ESDs directory exist + printf("%s does not exist\n", kInDir) ; + return ; + } + + //if(gSystem->Getenv("XSFILE")) + //kXSFileName = gSystem->Getenv("XSFILE") ; + //else cout<<" XS file name not set, use default: "<Getenv("GENER"); + if(kGener) { + cout<<"GENER "<Get(kTreeName) ) { + printf("++++ Adding %s\n", file) ; + chain->AddFile(file); + if(kGetXSectionFromFileAndScale)chainxs->Add(filexs) ; + } + } + else { + printf("---- Skipping %s\n", file) ; + skipped++ ; + } + } + printf("number of entries # %lld, skipped %d\n", chain->GetEntries(), skipped*100) ; + } + else { + TString input = "AliESDs.root" ; + cout<<">>>>>> No list added, take a single file <<<<<<<<< "<AddFile(input); + } + + }// local files analysis + + //------------------------------ + //GRID xml files + //----------------------------- + else if(mode == mGRID){ + //Get colection file. It is specified by the environmental + //variable XML + + if(gSystem->Getenv("XML") ) + kXML = gSystem->Getenv("XML"); + else + sprintf(kXML, "collection.xml") ; + + if (!TFile::Open(kXML)) { + printf("No collection file with name -- %s -- was found\n",kXML); + return ; + } + else cout<<"XML file "<Load("libNetx.so") ; + gSystem->Load("libRAliEn.so"); + TGrid::Connect("alien://") ; + + //Feed Grid with collection file + //TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\", 0)", kXML)); + TGridCollection * collection = (TGridCollection*) TAlienCollection::Open(kXML); + if (! collection) { + AliError(Form("%s not found", kXML)) ; + return kFALSE ; + } + TGridResult* result = collection->GetGridResult("",0 ,0); + + // Makes the ESD chain + printf("*** Getting the Chain ***\n"); + for (Int_t index = 0; index < result->GetEntries(); index++) { + TString alienURL = result->GetKey(index, "turl") ; + cout << "================== " << alienURL << endl ; + chain->Add(alienURL) ; + alienURL.ReplaceAll("AliESDs.root",kXSFileName); + chainxs->Add(alienURL) ; + } + }// xml analysis + + gSystem->ChangeDirectory(ocwd.Data()); +} + +//________________________________________________ +void GetAverageXsection(TTree * tree, Double_t & xs, Float_t & ntr) +{ + // Read the PYTHIA statistics from the file pyxsec.root created by + // the function WriteXsection(): + // integrated cross section (xsection) and + // the number of Pyevent() calls (ntrials) + // and calculate the weight per one event xsection/ntrials + // The spectrum calculated by a user should be + // multiplied by this weight, something like this: + // TH1F *userSpectrum ... // book and fill the spectrum + // userSpectrum->Scale(weight) + // + // Yuri Kharlov 19 June 2007 + // Gustavo Conesa 15 April 2008 + Double_t xsection = 0; + UInt_t ntrials = 0; + xs = 0; + ntr = 0; + + Int_t nfiles = tree->GetEntries() ; + if (tree && nfiles > 0) { + tree->SetBranchAddress("xsection",&xsection); + tree->SetBranchAddress("ntrials",&ntrials); + for(Int_t i = 0; i < nfiles; i++){ + tree->GetEntry(i); + xs += xsection ; + ntr += ntrials ; + cout << "xsection " <>>> Empty tree !!!! <<<<< "<Getenv("MODE")) + mode = atoi(gSystem->Getenv("MODE")); + + if (gSystem->Getenv("CONFIG1")) + sprintf(sconfig1,gSystem->Getenv("CONFIG1")); + + if (gSystem->Getenv("CONFIG2")) + sprintf(sconfig2,gSystem->Getenv("CONFIG2")); + + if (gSystem->Getenv("CONFIG3")) + sprintf(sconfig3,gSystem->Getenv("CONFIG3")); + + if (gSystem->Getenv("SEVENT")) + sevent = atoi (gSystem->Getenv("SEVENT")); + + printf("PROCESS: Variables: mode %d, config1 %s, config2 %s, config3 %s, sevent %d\n", mode,sconfig1,sconfig2,sconfig3,sevent); + + +} diff --git a/PWG4/macros/electrons/anaJete.jdl b/PWG4/macros/electrons/anaJete.jdl new file mode 100644 index 00000000000..225715d60c3 --- /dev/null +++ b/PWG4/macros/electrons/anaJete.jdl @@ -0,0 +1,41 @@ +Executable="root"; +Jobtag ={"Analysis: Processing collection for anlysis "}; +Packages ={"VO_ALICE@ROOT::v5-24-00","VO_ALICE@APISCONFIG::V2.4","VO_ALICE@fastjet::v2.4.0"}; + +TTL=30000; + +InputFile={"LF:/alice/cern.ch/user/k/kread/work12/anaJete.C", + "LF:/alice/cern.ch/user/k/kread/work12/run.C", + "LF:/alice/cern.ch/user/k/kread/work12/ConfigJetAnalysisFastJet.C", + "LF:/alice/cern.ch/user/k/kread/work12/ConfigAnalysisElectron.C", + "LF:/alice/cern.ch/user/k/kread/work12/STEERBase.par", + "LF:/alice/cern.ch/user/k/kread/work12/ESD.par", + "LF:/alice/cern.ch/user/k/kread/work12/AOD.par", + "LF:/alice/cern.ch/user/k/kread/work12/ANALYSIS.par", + "LF:/alice/cern.ch/user/k/kread/work12/ANALYSISalice.par", + "LF:/alice/cern.ch/user/k/kread/work12/JETAN.par", + "LF:/alice/cern.ch/user/k/kread/work12/FASTJETAN.par", + "LF:/alice/cern.ch/user/k/kread/work12/PWG4PartCorrBase.par", + "LF:/alice/cern.ch/user/k/kread/work12/PWG4PartCorrDep.par"}; +OutputArchive={"log_archive:stdout,stderr,*.log@ALICE::CERN::ALICEDISK", + "root_archive:*.root@ALICE::CERN::ALICEDISK"}; + +OutputDir = "/alice/cern.ch/user/k/kread/work12/output/#alien_counter_03i#"; + +InputDataCollection = "LF:/alice/cern.ch/user/k/kread/work12/mycollect.xml,nodownload"; + +InputDataListFormat = "xml-single"; +InputDataList = "collection.xml"; + +Split = "se"; +SplitMaxInputFileNumber = "15"; + +splitarguments="run.C --mode 3 --config1 ConfigPWG4AODtoAOD --config2 ConfigJetAnalysisFastJet.C --config3 ConfigAnalysisElectron --sevent 0"; + + +# Validation script to be run for each subjob +Validationcommand = "/alice/cern.ch/user/k/kread/work12/validate.sh"; + +OutputFile="histos.root"; +MergeOutputDir = "/alice/cern.ch/user/k/kread/work12/output/merged"; +Merge = {"histos.root:/alice/cern.ch/user/k/kread/work12/mergeout.jdl:histos-merged.root"}; diff --git a/PWG4/macros/electrons/anaJete.sh b/PWG4/macros/electrons/anaJete.sh new file mode 100755 index 00000000000..c5618444e6c --- /dev/null +++ b/PWG4/macros/electrons/anaJete.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# +# Author: K. Read +# + +export INDIR=/work2/data/test +export PATTERN= +#export INDIR=/work2/data/LHC08d6/AOD/000 +#export PATTERN=01 +export NFILES=1 +export MODE=0 +export CONFIG1=ConfigPWG4AODtoAOD +export CONFIG2=ConfigJetAnalysisFastJet.C +export CONFIG3=ConfigAnalysisElectron +export SIMPATH=/work2/data/bjetfilter/AOD/117005/004 +export SEVENT=0 + +root -q -b -l anaJete.C diff --git a/PWG4/macros/electrons/mergeElectron.jdl b/PWG4/macros/electrons/mergeElectron.jdl deleted file mode 100644 index c9a1e384279..00000000000 --- a/PWG4/macros/electrons/mergeElectron.jdl +++ /dev/null @@ -1,12 +0,0 @@ -Packages = - { - "VO_ALICE@ROOT::v5-23-04", - "VO_ALICE@APISCONFIG::V2.4" - }; - - Arguments = "27498605 histos.root histos-merged.root jklay /alice/cern.ch/user/j/jklay/work4/output"; - Executable = "/alice/bin/mergerootfile"; - Email = "jklay@calpoly.edu"; - OutputFile = "histos-merged.root@ALICE::Subatech::DPM"; - InputFile = "LF:/alice/macros/mergerootfile.C"; - OutputDir = "/alice/cern.ch/user/j/jklay/work4/output/merged"; diff --git a/PWG4/macros/electrons/mergeout.jdl b/PWG4/macros/electrons/mergeout.jdl new file mode 100644 index 00000000000..dd8c25ee222 --- /dev/null +++ b/PWG4/macros/electrons/mergeout.jdl @@ -0,0 +1,8 @@ +Packages ={"VO_ALICE@ROOT::v5-24-00","VO_ALICE@APISCONFIG::V2.4"}; + +Arguments = "27498605 histos.root histos-merged.root kread /alice/cern.ch/user/k/kread/work12/output"; +Executable = "/alice/bin/mergerootfile"; +Email = ""; +OutputFile = "histos-merged.root@ALICE::CERN::ALICEDISK"; +InputFile = "LF:/alice/macros/mergerootfile.C"; +OutputDir = "/alice/cern.ch/user/k/kread/work12/output/merged"; diff --git a/PWG4/macros/electrons/mergeoutscaled.jdl b/PWG4/macros/electrons/mergeoutscaled.jdl new file mode 100644 index 00000000000..4e2c5535e91 --- /dev/null +++ b/PWG4/macros/electrons/mergeoutscaled.jdl @@ -0,0 +1,8 @@ +Packages ={"VO_ALICE@ROOT::v5-24-00","VO_ALICE@APISCONFIG::V2.4"}; + +Arguments = "27498605 histosscaled.root histosscaled-merged.root kread /alice/cern.ch/user/k/kread/work12/output"; +Executable = "/alice/bin/mergerootfile"; +Email = ""; +OutputFile = "histosscaled-merged.root@ALICE::CERN::ALICEDISK"; +InputFile = "LF:/alice/macros/mergerootfile.C"; +OutputDir = "/alice/cern.ch/user/k/kread/work12/output/merged"; diff --git a/PWG4/macros/electrons/mylauncher.C b/PWG4/macros/electrons/mylauncher.C index 8168ed9e445..6c1e91fb625 100644 --- a/PWG4/macros/electrons/mylauncher.C +++ b/PWG4/macros/electrons/mylauncher.C @@ -6,13 +6,13 @@ void mylauncher() { - TString worksubdir = "work4"; + TString worksubdir = "work12"; // Name of JDL file to upload. Leave blank for no upload and no submit. - TString jdlfilename = "anaElectron.jdl"; + TString jdlfilename = "anaJete.jdl"; // Name of executable to upload. Leave blank for no upload. - TString execfilename = "anaElectron.sh"; + TString execfilename = ""; // List any other files to upload in string filenames separated by blanks. - TString filelist = "anaElectron.C ConfigAnalysisElectron.C mergeElectron.jdl mycollect.xml ANALYSIS.par ANALYSISalice.par AOD.par ESD.par STEERBase.par PWG4PartCorrBase.par PWG4PartCorrDep.par"; + TString filelist = "run.C validate.sh anaJete.C ConfigJetAnalysisFastJet.C ConfigAnalysisElectron.C mergeout.jdl mergeoutscaled.jdl mycollect.xml ANALYSIS.par ANALYSISalice.par AOD.par ESD.par STEERBase.par JETAN.par FASTJETAN.par PWG4PartCorrBase.par PWG4PartCorrDep.par"; TString filename; gSystem->Load("libNetx.so") ; diff --git a/PWG4/macros/electrons/myplot11.C b/PWG4/macros/electrons/myplot11.C new file mode 100644 index 00000000000..c26e81eee71 --- /dev/null +++ b/PWG4/macros/electrons/myplot11.C @@ -0,0 +1,15 @@ +{ + TFile *fin = TFile::Open("histos.root"); + TCanvas *myc1 = new TCanvas("myc1","myc1",1); +// myc1->SetLogx(1); +// myc1->SetLogy(1); + histos.Print(); + histos->FindObject("AnaElectron_hPtElectron")->Draw("pe"); +//AnaElectron_hPtElectron->GetXaxis()->SetRangeUser(1,200); +//AnaElectron_hPtElectron->GetYaxis()->SetRangeUser(1,4000); +//AnaElectron_hPtElectron->SetTitle("pT of Electron"); +//AnaElectron_hPtElectron->SetStats(kFALSE); +//AnaElectron_hPtElectron->Draw("pe"); + +// myc1->Print("electron.pdf"); +} diff --git a/PWG4/macros/electrons/myplot11s.C b/PWG4/macros/electrons/myplot11s.C new file mode 100644 index 00000000000..e28dc6d660b --- /dev/null +++ b/PWG4/macros/electrons/myplot11s.C @@ -0,0 +1,15 @@ +{ + TFile *fin = TFile::Open("histosscaled.root"); + TCanvas *myc1 = new TCanvas("myc1","myc1",1); +// myc1->SetLogx(1); +// myc1->SetLogy(1); + histosscaled.Print(); + histosscaled->FindObject("AnaElectron_hPtElectronScaled")->Draw("pe"); +//AnaElectron_hPtElectronScaled->GetXaxis()->SetRangeUser(1,200); +// AnaElectron_hPtElectronScaled->GetYaxis()->SetRangeUser(1,4000); +// AnaElectron_hPtElectronScaled->SetTitle("pT of Electron"); +// AnaElectron_hPtElectronScaled->SetStats(kFALSE); +// AnaElectron_hPtElectronScaled->Draw("pe"); + +// myc1->Print("electron.pdf"); +} diff --git a/PWG4/macros/electrons/parmaker b/PWG4/macros/electrons/parmaker index b493c5be256..fa4edf0e2a1 100755 --- a/PWG4/macros/electrons/parmaker +++ b/PWG4/macros/electrons/parmaker @@ -6,13 +6,13 @@ # This script makes PAR files without requiring write access to $ALICE_ROOT. # Execute this script in your local area with write access. # Usage: -# parmaker ANALYSIS -# parmaker ANALYSIS remote -# parmaker PWG4PartCorrDep -# parmaker PWG4PartCorrDep remote +# parmaker JETAN +# parmaker JETAN remote +# parmaker JETAN remote patch # # So far only available for these par files: -# ANALYSIS ANALYSISalice AOD ESD PWG4PartCorrBase PWG4PartCorrDep STEERBase +# ANALYSIS ANALYSISalice AOD ESD FASTJETAN JETAN +# PWG4PartCorrBase PWG4PartCorrDep STEERBase # case $2 in @@ -55,9 +55,19 @@ case $2 in parmaker_input_dir_subdir="STEER" parmaker_output_dir_subdir="STEERBase" ;; - *) - echo "parmaker: I'm sorry Dave, I'm afraid I can't do that." - exit + "JETAN") + parmaker_input_basedir="JETAN" + parmaker_input_dir_subdir="JETAN" + parmaker_output_dir_subdir="JETAN" + ;; + "FASTJETAN") + parmaker_input_basedir="JETAN" + parmaker_input_dir_subdir="JETAN" + parmaker_output_dir_subdir="FASTJETAN" + ;; + *) + echo "parmaker: I'm sorry Dave, I'm afraid I can't do that." + exit esac @@ -86,6 +96,38 @@ case $2 in sed -e 's:include \$(ROOTSYS)\/test\/Makefile.arch:include Makefile.arch:' -e "s:PACKAGE = .*:PACKAGE = ${1}:" $1/Makefiletemp > $1/Makefile /bin/rm $1/Makefiletemp + + +# Apply temporary patches. + if [ -z $3 ] + then + echo "no non-standard patches applied" + else + if [ $3 = "patch" ] + then + if [ -e "patches/$1" ] + then + echo "applying temporary $1 patch" + cp patches/$1/* $parmaker_output_dir_subdir + echo "completed temporary $1 patch" + else + echo "no patches found for $1" + fi + else + echo "argument $3 not processed" + fi + fi + +# Apply further FASTJETAN tweaks. + if [ $1 = "FASTJETAN" ] + then + echo "Making temporary adjustments to FASTJETAN.par." + cp -r $ALICE_ROOT/JETAN/fastjet FASTJETAN + + sed -e "s:CXXFLAGS +:\nALICEINC += -I../JETAN -I./fastjet -I./fastjet/fastjet\n\n\nCXXFLAGS +:" FASTJETAN/Makefile > FASTJETAN/Makefile2 + mv FASTJETAN/Makefile2 FASTJETAN/Makefile + fi + tar cfzh $1.par $1 /bin/rm -rf $1 fi -- 2.43.5