Browse Source

Added FlowCalculator (in progress) and README

PeterParfenov 2 years ago
parent
commit
2255b5e0b9
8 changed files with 108 additions and 2 deletions
  1. 2 0
      CMakeLists.txt
  2. 2 2
      Centrality/CMakeLists.txt
  3. 0 0
      Centrality/LinkDef.h
  4. 14 0
      Flow/CMakeLists.txt
  5. 23 0
      Flow/FlowCalculator.cxx
  6. 25 0
      Flow/FlowCalculator.h
  7. 9 0
      Flow/LinkDef.h
  8. 33 0
      README.md

+ 2 - 0
CMakeLists.txt

@@ -22,6 +22,7 @@ include(${ROOT_USE_FILE})
 set(INCLUDE_DIRECTORIES
 	  ${CMAKE_SOURCE_DIR}
 	  ${CMAKE_SOURCE_DIR}/Centrality
+	  ${CMAKE_SOURCE_DIR}/Flow
 	  ${ROOT_INCLUDE_DIRS})
 
 include_directories(${INCLUDE_DIRECTORIES})
@@ -31,6 +32,7 @@ set(CMAKE_BUILD_TYPE Debug)
 set(CMAKE_C_FLAGS "-O2")
 
 add_subdirectory(Centrality)
+add_subdirectory(Flow)
 
 add_executable(calcCent calcCent.cpp)
 target_link_libraries(calcCent Centrality)

+ 2 - 2
Centrality/CMakeLists.txt

@@ -4,12 +4,12 @@ set(Centrality_h_files
 
 set(Centrality_cxx_files
 	MultReader.cxx
-	CentralityCalculator.cxx ../calcCent.cpp)
+	CentralityCalculator.cxx)
 
 #---Generate dictionary
 ROOT_GENERATE_DICTIONARY(G__Centrality
 	${Centrality_h_files}
-	LINKDEF ${CMAKE_SOURCE_DIR}/LinkDef.h)
+	LINKDEF LinkDef.h)
 
 #---Create a shared library
 add_library(Centrality SHARED ${Centrality_cxx_files} G__Centrality.cxx)

LinkDef.h → Centrality/LinkDef.h


+ 14 - 0
Flow/CMakeLists.txt

@@ -0,0 +1,14 @@
+set(Flow_h_files
+	FlowCalculator.h)
+
+set(Flow_cxx_files
+	FlowCalculator.cxx)
+
+#---Generate dictionary
+ROOT_GENERATE_DICTIONARY(G__Flow
+	${Flow_h_files}
+	LINKDEF LinkDef.h)
+
+#---Create a shared library
+add_library(Flow SHARED ${Flow_cxx_files} G__Flow.cxx)
+target_link_libraries(Flow Centrality)

+ 23 - 0
Flow/FlowCalculator.cxx

@@ -0,0 +1,23 @@
+//
+// Created by peter on 8/27/19.
+//
+
+#include "FlowCalculator.h"
+
+ClassImp(FlowCalculator);
+
+FlowCalculator::FlowCalculator() {
+  centCalc = new CentralityCalculator();
+}
+
+FlowCalculator::~FlowCalculator() {
+  delete centCalc;
+}
+
+void FlowCalculator::LoopRes(TString outName) {
+
+}
+
+void FlowCalculator::LoopFlow(TString outName) {
+
+}

+ 25 - 0
Flow/FlowCalculator.h

@@ -0,0 +1,25 @@
+//
+// Created by peter on 8/27/19.
+//
+
+#ifndef MODELTREE_FLOWCALCULATOR_H
+#define MODELTREE_FLOWCALCULATOR_H
+
+#include "MultReader.h"
+#include "CentralityCalculator.h"
+
+class FlowCalculator : public MultReader {
+private:
+  CentralityCalculator *centCalc;
+public:
+  FlowCalculator();
+  virtual ~FlowCalculator();
+
+  void LoopRes(TString outName);
+  void LoopFlow(TString outName);
+
+  ClassDef(FlowCalculator,0);
+};
+
+
+#endif //MODELTREE_FLOWCALCULATOR_H

+ 9 - 0
Flow/LinkDef.h

@@ -0,0 +1,9 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class FlowCalculator+;
+
+#endif

+ 33 - 0
README.md

@@ -0,0 +1,33 @@
+Installation:
+
+git clone https://devel.mephi.ru/PEParfenov/FlowModelCalculator.git
+
+cd FlowModelCalculator/
+mkdir build
+cd build/
+cmake ..
+
+Centrality determination. Usage:
+
+1. Get multiplicity histogram:
+
+        root -l
+        .L Centrality/libCentrality.so
+        TChain *chain = new TChain("mctree")
+        chain->Add("...") // Add files into TChain
+        MultReader *multReader = new MultReader(chain)
+        multReader->Loop("OUTPUTNAME") // Output of the root file
+
+2. Calculate centrality:
+
+        root -l
+        .L Centrality/libCentrality.so
+        TFile *fi = new TFile("...","read") // Output file from previous step
+        TH1F *hist = (TH1F*) fi->Get("hMult")
+        CentralityCalculator *centCalc = new CentralityCalculator()
+        centCalc->SetModel("MODEL_NAME")
+        centCalc->SetEnergy(ENERGY)
+        centCalc->SetHistogram(hist)
+        centCalc->Calc();
+
+        Int_t centrality = centCalc->GetCentrality(mult)