]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
updates for running with plugin
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 4 Sep 2010 10:16:47 +0000 (10:16 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 4 Sep 2010 10:16:47 +0000 (10:16 +0000)
PWG4/totEt/AliAnalysisEt.cxx
PWG4/totEt/AliAnalysisEt.h
PWG4/totEt/macros/CreateAlienHandlerCaloEtSim.C
PWG4/totEt/macros/runCaloEt.C

index cc17d08282401f339d75f1b4965566668bbc6e51..c7db4fa732f094fa0f249f8fcef1b117704c58fd 100644 (file)
@@ -123,30 +123,7 @@ void AliAnalysisEt::Init()
 {
 
   if(!fPdgDB) fPdgDB = new TDatabasePDG();
-  PionMass = fPdgDB->GetParticle("pi+")->Mass();
-  PiPlusCode = fPdgDB->GetParticle("pi+")->PdgCode();
-    PiMinusCode = fPdgDB->GetParticle("pi-")->PdgCode();
-    KPlusCode = fPdgDB->GetParticle("K+")->PdgCode();
-    KMinusCode = fPdgDB->GetParticle("K-")->PdgCode();
-    ProtonCode = fPdgDB->GetParticle("proton")->PdgCode();
-    AntiProtonCode = fPdgDB->GetParticle("antiproton")->PdgCode();
-    LambdaCode = fPdgDB->GetParticle("Lambda0")->PdgCode();
-    AntiLambdaCode = fPdgDB->GetParticle("Lambda0_bar")->PdgCode();
-    K0SCode = fPdgDB->GetParticle("K_S0")->PdgCode();
-    OmegaCode = fPdgDB->GetParticle("Omega-")->PdgCode();
-    AntiOmegaCode = fPdgDB->GetParticle("Omega+")->PdgCode();
-    Xi0Code = fPdgDB->GetParticle("Xi0")->PdgCode();
-    AntiXi0Code = fPdgDB->GetParticle("Xi0_bar")->PdgCode();
-    XiCode = fPdgDB->GetParticle("Xi-")->PdgCode();
-    AntiXiCode = fPdgDB->GetParticle("Xi-_bar")->PdgCode();
-    SigmaCode = fPdgDB->GetParticle("Sigma-")->PdgCode();
-    AntiSigmaCode = fPdgDB->GetParticle("Sigma+")->PdgCode();
-    K0LCode = fPdgDB->GetParticle("K_L0")->PdgCode();
-    NeutronCode = fPdgDB->GetParticle("neutron")->PdgCode();
-    AntiNeutronCode = fPdgDB->GetParticle("antineutron")->PdgCode();
-    EPlusCode = fPdgDB->GetParticle("e+")->PdgCode();
-    EMinusCode = fPdgDB->GetParticle("e-")->PdgCode();
-
+  SetParticleCodes();
 }
 
 void AliAnalysisEt::CreateHistograms()
@@ -277,4 +254,42 @@ void AliAnalysisEt::ResetEventValues()
     fMultiplicity = 0;
     fChargedMultiplicity = 0;
     fNeutralMultiplicity = 0;
+
+    if(!fPdgDB) fPdgDB = new TDatabasePDG();
+
+    if(PiPlusCode==0){
+      SetParticleCodes();
+    }
 }
+
+void AliAnalysisEt::SetParticleCodes()
+{     
+  PionMass = fPdgDB->GetParticle("pi+")->Mass();
+  PiPlusCode = fPdgDB->GetParticle("pi+")->PdgCode();
+  PiMinusCode = fPdgDB->GetParticle("pi-")->PdgCode();
+  KPlusCode = fPdgDB->GetParticle("K+")->PdgCode();
+  KMinusCode = fPdgDB->GetParticle("K-")->PdgCode();
+  ProtonCode = fPdgDB->GetParticle("proton")->PdgCode();
+  AntiProtonCode = fPdgDB->GetParticle("antiproton")->PdgCode();
+  LambdaCode = fPdgDB->GetParticle("Lambda0")->PdgCode();
+  AntiLambdaCode = fPdgDB->GetParticle("Lambda0_bar")->PdgCode();
+  K0SCode = fPdgDB->GetParticle("K_S0")->PdgCode();
+  OmegaCode = fPdgDB->GetParticle("Omega-")->PdgCode();
+  AntiOmegaCode = fPdgDB->GetParticle("Omega+")->PdgCode();
+  Xi0Code = fPdgDB->GetParticle("Xi0")->PdgCode();
+  AntiXi0Code = fPdgDB->GetParticle("Xi0_bar")->PdgCode();
+  XiCode = fPdgDB->GetParticle("Xi-")->PdgCode();
+  AntiXiCode = fPdgDB->GetParticle("Xi-_bar")->PdgCode();
+  SigmaCode = fPdgDB->GetParticle("Sigma-")->PdgCode();
+  AntiSigmaCode = fPdgDB->GetParticle("Sigma+")->PdgCode();
+  K0LCode = fPdgDB->GetParticle("K_L0")->PdgCode();
+  NeutronCode = fPdgDB->GetParticle("neutron")->PdgCode();
+  AntiNeutronCode = fPdgDB->GetParticle("antineutron")->PdgCode();
+  EPlusCode = fPdgDB->GetParticle("e+")->PdgCode();
+  EMinusCode = fPdgDB->GetParticle("e-")->PdgCode();
+  cout << "Resetting Codes: Pion " << PiPlusCode
+       << "," << PiMinusCode 
+       << " Kaon " << KPlusCode 
+       << "," << KMinusCode << endl;
+}
+
index 6087334b8711a6a8be2dc078e64614621e85b6c3..b2b5f0d4459015b12b85d066f1802c648b62f560 100644 (file)
@@ -44,6 +44,9 @@ public:
 
     /** Reset event specific values (Et etc.) */
     virtual void ResetEventValues();
+
+    /** Set Particle codes/mass */
+    virtual void SetParticleCodes();
     
     /** Sum of the total Et for all events */
     Double_t GetSumEt() { return fSumEt; }
index 23b18d3a1c6d98a9d1b4b9ab79e41cd03690ab2f..7997a829f1b0ca17411c4c7f6171203c57747464 100644 (file)
@@ -1,76 +1,75 @@
- AliAnalysisGrid* CreateAlienHandlerCaloEtSim()
+AliAnalysisGrid* CreateAlienHandlerCaloEtSim(TString outputDir, TString outputName)
 {
-// 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.
-   if (!AliAnalysisGrid::CreateToken()) return NULL;
-   AliAnalysisAlien *plugin = new AliAnalysisAlien();
+  // 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.
+  if (!AliAnalysisGrid::CreateToken()) return NULL;
+  AliAnalysisAlien *plugin = new AliAnalysisAlien();
 
-// Overwrite all generated files, datasets and output results from a previous session
-   plugin->SetOverwriteMode();
-// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
-   //plugin->SetRunMode("full");  // VERY IMPORTANT - DECRIBED BELOW
-   plugin->SetRunMode("full");  // VERY IMPORTANT - DECRIBED BELOW
-// Set versions of used packages
-   plugin->SetAPIVersion("V1.1x");
-   plugin->SetROOTVersion("v5-26-00b-6");
-   plugin->SetAliROOTVersion("v4-20-04-AN");
-// Declare input data to be processed.
+  // Overwrite all generated files, datasets and output results from a previous session
+  plugin->SetOverwriteMode();
+  // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
+  plugin->SetRunMode("full");  // VERY IMPORTANT - DECRIBED BELOW
+  //plugin->SetRunMode("test");  // VERY IMPORTANT - DECRIBED BELOW
+  // Set versions of used packages
+  plugin->SetAPIVersion("V1.1x");
+  plugin->SetROOTVersion("v5-26-00b-6");
+  plugin->SetAliROOTVersion("v4-20-06-AN");
+  // Declare input data to be processed.
 
-// Method 1: Create automatically XML collections using alien 'find' command.
-// Define production directory LFN
-//   plugin->SetGridDataDir("/alice/sim/LHC10a18");
-// Set data search pattern
-//   plugin->SetDataPattern("*ESDs.root");  // simulated, tags not used
-//   plugin->SetDataPattern("*ESDs/pass4/*ESDs.root"); // real data check reco pass and data base directory
-//   plugin->SetRunPrefix("000");   // real data
-//   plugin->SetDataPattern("*tag.root");  // Use ESD tags (same applies for AOD's)
-// ...then add run numbers to be considered
-//   plugin->AddRunNumber(125020);    // simulated
-//   plugin->AddRunNumber(104065);  // real data
+  // Method 1: Create automatically XML collections using alien 'find' command.
+  // Define production directory LFN
+  //   plugin->SetGridDataDir("/alice/sim/LHC10a18");
+  // Set data search pattern
+  //   plugin->SetDataPattern("*ESDs.root");  // simulated, tags not used
+  //   plugin->SetDataPattern("*ESDs/pass4/*ESDs.root"); // real data check reco pass and data base directory
+  //   plugin->SetRunPrefix("000");   // real data
+  //   plugin->SetDataPattern("*tag.root");  // Use ESD tags (same applies for AOD's)
+  // ...then add run numbers to be considered
+  //   plugin->AddRunNumber(125020);    // simulated
+  //   plugin->AddRunNumber(104065);  // real data
 
-// 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");
+  // 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");
+  // file generated with:  find -x tag /alice/sim/LHC10d1/117222/* AliESDs.root > tag.xml
 
-// Define alien work directory where all files will be copied. Relative to alien $HOME.
-   plugin->SetGridWorkingDir("etOystein");
-// Declare alien output directory. Relative to working directory.
-   plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
-// Declare the analysis source files names separated by blancs. To be compiled runtime IN THE SAME ORDER THEY ARE LISTED
-// using ACLiC on the worker nodes.
-   //plugin->SetAnalysisSource("AliAnalysisTaskHadEt.cxx");
-   //plugin->SetAnalysisSource("AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisTaskTotEt.cxx");
-   plugin->SetAnalysisSource("AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.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("AliAnalysisEtCuts.h AliAnalysisEt.h AliAnalysisEtMonteCarlo.h AliAnalysisEtMonteCarloPhos.h AliAnalysisEtMonteCarloEmcal.h AliAnalysisEtReconstructed.h AliAnalysisEtReconstructedPhos.h AliAnalysisEtReconstructedEmcal.h AliAnalysisTaskTotEt.h AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx");
-// No need for output file names. Procedure is automatic. <-- not true
-   plugin->SetDefaultOutputs(kFALSE);
-   plugin->SetOutputFiles("Et.ESD.sim.root");
-// No need define the files to be archived. Note that this is handled automatically by the plugin.
-//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
-// Set a name for the generated analysis macro (default MyAnalysis.C) Make this unique !
-   plugin->SetAnalysisMacro("OysteinsEtAnalysis.C");
-// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore). The optimum for an analysis
-// is correlated with the run time - count few hours TTL per job, not minutes !
-   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(20000);
-// Optionally set input format (default xml-single)
-   plugin->SetInputFormat("xml-single");
-// Optionally modify the name of the generated JDL (default analysis.jdl)
-   plugin->SetJDLName("TaskEt.jdl");
-// Optionally modify job price (default 1)
-   plugin->SetPrice(1); 
-// Optionally modify split mode (default 'se')    
-   plugin->SetSplitMode("se");
-   return plugin;
+  // Define alien work directory where all files will be copied. Relative to alien $HOME.
+  plugin->SetGridWorkingDir(outputDir.Data());
+  // Declare alien output directory. Relative to working directory.
+  plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
+  // Declare the analysis source files names separated by blancs. To be compiled runtime IN THE SAME ORDER THEY ARE LISTED
+  // using ACLiC on the worker nodes.
+  plugin->SetAnalysisSource("AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.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("AliAnalysisEtCuts.h AliAnalysisEt.h AliAnalysisEtMonteCarlo.h AliAnalysisEtMonteCarloPhos.h AliAnalysisEtMonteCarloEmcal.h AliAnalysisEtReconstructed.h AliAnalysisEtReconstructedPhos.h AliAnalysisEtReconstructedEmcal.h AliAnalysisTaskTotEt.h AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx");
+
+  // No need for output file names. Procedure is automatic. <-- not true
+  plugin->SetDefaultOutputs(kFALSE);
+  plugin->SetOutputFiles(outputName.Data());
+  // No need define the files to be archived. Note that this is handled automatically by the plugin.
+  //   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
+  // Set a name for the generated analysis macro (default MyAnalysis.C) Make this unique !
+  plugin->SetAnalysisMacro("DavidEtAnalysis.C");
+  // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore). The optimum for an analysis
+  // is correlated with the run time - count few hours TTL per job, not minutes !
+  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(20000);
+  // Optionally set input format (default xml-single)
+  plugin->SetInputFormat("xml-single");
+  // Optionally modify the name of the generated JDL (default analysis.jdl)
+  plugin->SetJDLName("TaskEt.jdl");
+  // Optionally modify job price (default 1)
+  plugin->SetPrice(1); 
+  // Optionally modify split mode (default 'se')    
+  plugin->SetSplitMode("se");
+  return plugin;
 } 
index dedba1e2610175be656b30064829126a47db4cca..a0d278e3b9182b84fe595461b9d77f537926dff9 100644 (file)
@@ -4,21 +4,30 @@
 //by default this runs locally
 //With the argument true this submits jobs to the grid
 //As written this requires an xml script tag.xml in the ~/et directory on the grid to submit jobs
-void runCaloEt(bool submit = false) {
-    TStopwatch timer;
-    timer.Start();
-    gSystem->Load("libTree.so");
-    gSystem->Load("libGeom.so");
-    gSystem->Load("libVMC.so");
-    gSystem->Load("libXMLIO.so");
-
-    gSystem->Load("libSTEERBase.so");
-    gSystem->Load("libESD.so");
-    gSystem->Load("libAOD.so");
-
-    gSystem->Load("libANALYSIS");
-    gSystem->Load("libANALYSISalice");
-
+void runCaloEt(bool submit = true, // true or false 
+              const char *dataType="sim", // "sim" or "real" or "simPbPb"
+              const char *det = "EMCAL") // "PHOS" or "EMCAL"
+{
+  TStopwatch timer;
+  timer.Start();
+  gSystem->Load("libTree.so");
+  gSystem->Load("libGeom.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libXMLIO.so");
+  
+  gSystem->Load("libSTEERBase.so");
+  gSystem->Load("libESD.so");
+  gSystem->Load("libAOD.so");
+  
+  gSystem->Load("libANALYSIS");
+  gSystem->Load("libANALYSISalice");
+  
+  if (!submit) { // assume the stuff you need is compiled
+    cout << "local - no submitting" << endl;
+    gSystem->Load("libPWG4totEt");
+  }
+  else { 
+    cout << "submitting to grid" << endl;
     gSystem->AddIncludePath("-I$ALICE_ROOT/include");
     gROOT->ProcessLine(".L AliAnalysisEt.cxx+g");
     gROOT->ProcessLine(".L AliAnalysisEtMonteCarlo.cxx+g");
@@ -27,13 +36,12 @@ void runCaloEt(bool submit = false) {
     gROOT->ProcessLine(".L AliAnalysisEtReconstructed.cxx+g");
     gROOT->ProcessLine(".L AliAnalysisEtReconstructedPhos.cxx+g");
     gROOT->ProcessLine(".L AliAnalysisEtReconstructedEmcal.cxx+g");
-
+    
     gROOT->ProcessLine(".L AliAnalysisTaskTotEt.cxx+g");
-
+  }
 
   char *kTreeName = "esdTree" ;
   TChain * chain   = new TChain(kTreeName,"myESDTree") ;
-
   
   if(submit){      
     gSystem->Load("libNetx.so") ; 
@@ -41,16 +49,22 @@ void runCaloEt(bool submit = false) {
     gSystem->Load("libRAliEn.so"); 
     TGrid::Connect("alien://") ;
   }
-  chain->Add("/data/LHC10d15/1821/AliESDs.root");//CN changed
-
-
   
   // Make the analysis manager
   AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager");
   
+  TString detStr(det);
+  TString taskName = "TaskTotEt" + detStr;
+  TString dataStr(dataType);
+  TString outputName = "Et.ESD." + dataStr + "." + detStr + ".root";
+  TString outputDir = "totEt" + dataStr;
+
+  cout << " taskName " << taskName
+       << " outputName " << outputName << endl;
+
   if(submit){
-    gROOT->LoadMacro("CreateAlienHandlerPhosEtSim.C");
-    AliAnalysisGrid *alienHandler = CreateAlienHandlerPhosEtSim();  
+    gROOT->LoadMacro("CreateAlienHandlerCaloEtSim.C");
+    AliAnalysisGrid *alienHandler = CreateAlienHandlerCaloEtSim(outputDir, outputName);  
     if (!alienHandler) return;
     mgr->SetGridHandler(alienHandler);
   }
@@ -58,34 +72,43 @@ void runCaloEt(bool submit = false) {
   AliVEventHandler* esdH = new AliESDInputHandler;
   mgr->SetInputEventHandler(esdH);
   AliMCEventHandler* handler = new AliMCEventHandler;
-  handler->SetReadTR(kFALSE);
-  mgr->SetMCtruthEventHandler(handler);
-  
-  AliAnalysisTaskTotEt *task1 = new AliAnalysisTaskTotEt("TaskTotEt");
-  mgr->AddTask(task1);
-
-    // Create containers for input/output
-    //AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1", TChain::Class(),AliAnalysisManager::kInputContainer);
-    AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
-
-    //AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer,"Et.ESD.sim.root");
-    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer,"Et.ESD.sim.root");
-
-    //____________________________________________//
-    mgr->ConnectInput(task1,0,cinput1);
-    mgr->ConnectOutput(task1,1,coutput1);
+  if ( dataStr.Contains("sim") ) {
+    cout << " MC " << endl;
+    chain->Add("/home/dsilverm/data/E_T/sim/LHC10d1/117222/100/AliESDs.root"); // link to local test file
+    if ( dataStr.Contains("PbPb") ) {
+      cout << " PbPb " << endl;
+      chain->Add("/home/dsilverm/data/E_T/sim/LHC10e11/191001/001/AliESDs.root"); // link to local test file
+    }
+    handler->SetReadTR(kFALSE);
+    mgr->SetMCtruthEventHandler(handler);
+  }
+  else {
+  chain->Add("/home/dsilverm/data/E_T/data/2010/LHC10b/000117222/ESDs/pass2/10000117222021.30/AliESDs.root"); // link to local test file
+    cout << " not MC " << endl;
+  }
 
-    mgr->SetDebugLevel(0);
 
-    if (!mgr->InitAnalysis()) return;
-    mgr->PrintStatus();
-    if(submit){
-      mgr->StartAnalysis("grid");
-    }
-    else{
-      mgr->StartAnalysis("local",chain);
-    }
+  AliAnalysisTaskTotEt *task1 = new AliAnalysisTaskTotEt(taskName);
+  mgr->AddTask(task1);
 
-    timer.Stop();
-    timer.Print();
+  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer, outputName);
+  
+  //____________________________________________//
+  mgr->ConnectInput(task1,0,cinput1);
+  mgr->ConnectOutput(task1,1,coutput1);
+  
+  mgr->SetDebugLevel(0);
+  
+  if (!mgr->InitAnalysis()) return;
+  mgr->PrintStatus();
+  if(submit){
+    mgr->StartAnalysis("grid");
+  }
+  else{
+    mgr->StartAnalysis("local",chain);
+  }
+  
+  timer.Stop();
+  timer.Print();
 }