jet macros
authorjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 May 2009 15:33:30 +0000 (15:33 +0000)
committerjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 May 2009 15:33:30 +0000 (15:33 +0000)
HLT/JET/macros/HLTJetReconstruction.C
HLT/JET/macros/readJets.C [new file with mode: 0644]
HLT/JET/macros/rootlogon.C [new file with mode: 0644]
HLT/JET/macros/run.sh [new file with mode: 0755]

index 268da29..ca04a40 100644 (file)
  * @ingroup alihlt_jet
  */
 
+// ---------------------------------------------------------------------------- 
+// -- Pythia Parameter 
+// ---------------------------------------------------------------------------- 
+
+enum PprRun_t {
+  kPythia6Jets20_24,   kPythia6Jets24_29,   kPythia6Jets29_35,
+  kPythia6Jets35_42,   kPythia6Jets42_50,   kPythia6Jets50_60,
+  kPythia6Jets60_72,   kPythia6Jets72_86,   kPythia6Jets86_104,
+  kPythia6Jets104_125, kPythia6Jets125_150, kPythia6Jets150_180,
+  kPyJetJet, kPyGammaJetPHOS, kRunMax
+};
+
+const Char_t* pprRunName[] = {
+  "kPythia6Jets20_24",   "kPythia6Jets24_29",   "kPythia6Jets29_35",
+  "kPythia6Jets35_42",   "kPythia6Jets42_50",   "kPythia6Jets50_60",
+  "kPythia6Jets60_72",   "kPythia6Jets72_86",   "kPythia6Jets86_104",
+  "kPythia6Jets104_125", "kPythia6Jets125_150", "kPythia6Jets150_180",
+  "kPyJetJet", "kPyGammaJetPHOS"
+};
+
+// ---------------------------------------------------------------------------- 
+
+
 /** HLTJetReconstruction test macro
  *  @param nEvents Number of events which should be processed
  */
-void HLTJetReconstruction(Int_t nEvents=1) {
+void HLTJetReconstruction(Int_t nEvents=1, Int_t idx=0, Bool_t generate=kFALSE, PprRun_t runType = kPythia6Jets104_125 ) {
 
   TString writerInput;
-  TString arg;
+  TString analysisInput;
+  TString jetInput;
 
-  // this is just a tool to switch the logging systems
+  // -- Switch Logging
+  // -------------------
+  AliLog::SetGlobalLogLevel( AliLog::kError );
   AliHLTLogging log;
-  log.SwitchAliLog(1);
+  log.SwitchAliLog(0);
 
+  // -- Initialize HLT
+  // -------------------
   AliHLTSystem gHLT;
-  gHLT.SetGlobalLoggingLevel(0x3F);
+  gHLT.SetGlobalLoggingLevel(0x7D);
 
   gHLT.LoadComponentLibraries("libCGAL.so");
   gHLT.LoadComponentLibraries("libfastjet.so");
@@ -39,61 +67,141 @@ void HLTJetReconstruction(Int_t nEvents=1) {
   gHLT.LoadComponentLibraries("libAliHLTUtil.so");
   gHLT.LoadComponentLibraries("libAliHLTJET.so");  
 
+  gHLT.LoadComponentLibraries("liblhapdf.so");  
+  gHLT.LoadComponentLibraries("libEGPythia6.so");   
+  gHLT.LoadComponentLibraries("libpythia6.so");  
+  gHLT.LoadComponentLibraries("libAliPythia6.so");  
+
+  // ----------------------------//
+  // -                         - //
+  // -- Parameters            -- //
+  // -                         - //
+  // ----------------------------//
+
+  Float_t aConeRadius[] = { 0.4, 0.7 };
+  Float_t aCutPtSeed[]  = { 4.0, 7.0, 10.0 };
+  Float_t aCutEtJet[]   = { 4.0, 7.0, 10.0, 15.0 };
+
+  Float_t coneRadius = 0.7;
+  Float_t cutPtSeed  = 4.0;
+  Float_t cutEtJet   = 7.0;
+
+  Int_t seed = 12345;
+
   // ----------------------------//
   // -                         - //
   // -- Publisher  Components -- //
   // -                         - //
   // ----------------------------//
 
-  arg.Form("-entrytype MCFAST -dataspec 0x0000001F -datapath /home/jthaeder/jet/data/HEAD_2009-03-17/FastGen/kPythia6Jets104_125_14TeV/JET-ETA=-0.2,0.2_JET-ET=50,1000_R=0.4_10ev");
+  // ------------------------------------------
+  // -- The ESDMCEventPublisher   
+  // ------------------------------------------
+  if ( ! generate ) {
 
-  // jet/data/v4-16-Rev-01/FastGen/kPythia6Jets104_125_14TeV/JET-ETA=-0.2,0.2_JET-ET=50,1000_R=0.4_10ev");
+    TString publisherId("ESDMCEventPublisher");
 
-  // -- The ESDMCEventPublisher 
-  AliHLTConfiguration ESDMCEventPublisher("ESDMCEventPublisher", "ESDMCEventPublisher", 
-                                         NULL, arg.Data() );
-  
-  if (!writerInput.IsNull()) writerInput+=" ";
-  writerInput+="ESDMCEventPublisher";
+    TString publisherArg( Form("-entrytype MCFAST -dataspec 0x0000001F -datapath /home/jthaeder/jet/data/HEAD_2009-03-17/FastGen/kPythia6Jets104_125_14TeV/JET-ETA=-0.2,0.2_JET-ET=50,1000_R=0.4_10ev") );
+    
+    AliHLTConfiguration ESDMCEventPublisher(publisherId.Data(), "ESDMCEventPublisher", NULL, publisherArg.Data() );
+
+    if (!analysisInput.IsNull()) analysisInput+=" ";
+    analysisInput += publisherId;
+
+    if (!jetInput.IsNull()) jetInput+=" ";
+    jetInput += publisherId;
+  }
+
+  // ------------------------------------------
+  // -- The MCGenerator
+  // ------------------------------------------
+  else {
+    
+    TString generatorId( Form("MCGenerator_%s", pprRunName[runType]) );
+
+    TString generatorArg( Form("-seed %d -nevents %d -runtype %d -coneRadius %.1f -jetCutMinEt %.1f", 
+                              seed, nEvents, runType, coneRadius, cutEtJet));
+    
+    AliHLTConfiguration mcGenerator(generatorId.Data(), "MCGenerator", NULL, generatorArg.Data() );
+
+    if (!analysisInput.IsNull()) analysisInput+=" ";
+    analysisInput += generatorId;
+
+    if (!jetInput.IsNull()) jetInput+=" ";
+    jetInput += generatorId;
+  }
 
   // ----------------------------//
   // -                         - //
   // -- Processing Components -- //
   // -                         - //
   // ----------------------------//
-
+#if 1
+  // ------------------------------------------
   // -- ConeJetFinder
-  AliHLTConfiguration jetFinder("JETConeJet", "JETConeJetFinder",
-                               "ESDMCEventPublisher","");
+  // ------------------------------------------
+
+  TString jetId("JETConeJet");
+
+  TString jetArg( Form("-coneRadius %.1f -trackCutMinPt 0.0 -seedCutMinPt %.1f -jetCutMinEt %.1f",
+                      coneRadius, cutPtSeed, cutEtJet) );
   
-  if (!writerInput.IsNull()) writerInput+=" ";
-  writerInput+="JETConeJet";
+  AliHLTConfiguration jetCone(jetId.Data(), "JETConeJetFinder", jetInput.Data(), jetArg.Data()); 
   
+  if (!analysisInput.IsNull()) analysisInput+=" ";
+  analysisInput += jetId;
+  
+#else
+  // ------------------------------------------
   // -- FastJetFinder
-  /*
-    AliHLTConfiguration jetFinder("JETFastJet", "JETFastJetFinder",
-    "ESDMCEventPublisher","");
+  // ------------------------------------------
+
+  AliHLTConfiguration jetFinder("JETFastJet_Kt", "JETFastJetFinder",
+                               jetInput.Data(),"-finderType kt");
     
-    if (!writerInput.IsNull()) writerInput+=" ";
-    writerInput+="JETFastJet";
-  */
+  if (!writerInput.IsNull()) writerInput+=" ";
+  writerInput+="JETFastJet_Kt";
+  
+  
+  AliHLTConfiguration jetFinder("JETFastJet_AntiKt", "JETFastJetFinder",
+                               jetInput.Data(),"-finderType antikt");
+  
+  if (!writerInput.IsNull()) writerInput+=" ";
+  writerInput+="JETFastJet_AntiKt";
+#endif
+  
+  // ------------------------------------------
+  // -- Jet Analysis 
+  // ------------------------------------------
 
+  TString analysisId("JETAnalysis");
+  TString analysisArg("");
+  
+  AliHLTConfiguration jetAnalysis(analysisId.Data(), "JETAnalysis", analysisInput.Data(), analysisArg.Data() );
+
+  if (!writerInput.IsNull()) writerInput+=" ";
+  writerInput += analysisId;
+  
   // ----------------------------//
   // -                         - //
   // --    Sink Components    -- //
   // -                         - //
   // ----------------------------//
+  
+  TString writerArg( Form("-directory analysis -datafile analyze_%d_%s -write-all-events", nEvents, pprRunName[runType] ));
 
   // -- The RootFileWriter 
   AliHLTConfiguration rootWriter("RootWriter", "ROOTFileWriter", 
-                                writerInput.Data(), "-datafile event");
-
-
+                                writerInput.Data(), writerArg.Data() );
+  
+  // --------------------------- //
   // -                         - //
   // --         Run           -- //
   // -                         - //
+  // --------------------------- //
 
   gHLT.BuildTaskList("RootWriter");
   gHLT.Run(nEvents);
 
+  return;
 }
diff --git a/HLT/JET/macros/readJets.C b/HLT/JET/macros/readJets.C
new file mode 100644 (file)
index 0000000..24e0c7b
--- /dev/null
@@ -0,0 +1,32 @@
+void readJets( Char_t* fileName = "./analysis/EOR_analyze_100000_kPythia6Jets104_125.root" ) {
+
+  gSystem->Load("libCGAL.so");
+  gSystem->Load("${FASTJET}/lib/libfastjet.so");
+  
+  gSystem->Load("libTree.so");
+  gSystem->Load("libPhysics.so");
+  gSystem->Load("libGeom.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libANALYSIS.so");
+  gSystem->Load("libSTEERBase.so");
+  gSystem->Load("libAOD.so");
+  gSystem->Load("libESD.so");
+  gSystem->Load("libANALYSISalice.so");
+  gSystem->Load("libJETAN.so");
+
+  gSystem->Load("libAliHLTUtil.so");
+  gSystem->Load("libAliHLTJET.so");
+  
+  TFile* f = new TFile(fileName);
+
+  AliHLTJETAnalysisJets* jets = NULL;
+  
+  jets = static_cast<AliHLTJETAnalysisJets*>(f->Get("AliHLTJETAnalysisJets"));
+  
+  AliHLTJETAnalysisMerge* merge = new AliHLTJETAnalysisMerge();
+  merge->Initialize();
+
+  merge->AddJets( jets ); 
+    
+  merge->CreateCanvas();
+}
diff --git a/HLT/JET/macros/rootlogon.C b/HLT/JET/macros/rootlogon.C
new file mode 100644 (file)
index 0000000..83e2b09
--- /dev/null
@@ -0,0 +1,15 @@
+void rootlogon() {
+   printf("\nWELCOME to ALICE\n\n");
+   TInterpreter * mycint = gROOT->GetInterpreter();
+   mycint->AddIncludePath("$ALICE_ROOT/include");
+   mycint->AddIncludePath("$ALICE_ROOT/PYTHIA6");
+   mycint->AddIncludePath("$ROOTSYS/include");
+   mycint->AddIncludePath("$ALICE_ROOT");
+   mycint->AddIncludePath("$ALICE_ROOT/HLT/BASE");
+   mycint->AddIncludePath("$ALICE_ROOT/HLT/BASE/util");
+   mycint->AddIncludePath("$ALICE_ROOT/HLT/JET");
+   mycint->AddIncludePath("$ALICE_ROOT/HLT/JET/cone");
+
+   gStyle->SetPalette(1);      
+   gROOT->SetStyle("Plain");
+}
diff --git a/HLT/JET/macros/run.sh b/HLT/JET/macros/run.sh
new file mode 100755 (executable)
index 0000000..1794f74
--- /dev/null
@@ -0,0 +1,21 @@
+#/bin/bash
+
+
+if [ ! -d ./analysis ] ; then
+    mkdir analysis
+fi
+
+ROOTFILES=`find . -maxdepth 1 -name "*.root" `
+
+
+if [ -n "${ROOTFILES}" ] ; then
+    rm ${ROOTFILES}
+fi
+
+aliroot -b -l -q 'HLTJetReconstruction.C(100,0,kTRUE)'
+
+
+
+
+
+#valgrind --error-limit=no --leak-check=full --show-reachable=yes aliroot -b -l -q 'HLTJetReconstruction.C(10)' 2>&1 | tee valgrind.log