From ce91d7fa0287fc2dfa8ca8cf8340f3cbe855e8ab Mon Sep 17 00:00:00 2001 From: Oleg <oleg.golosov@gmail.com> Date: Thu, 12 Nov 2020 11:34:18 +0100 Subject: [PATCH] remove DataTree, DataTreeCbmInterface and DataTreeQA - replaced by AnalysisTree --- analysis/CMakeLists.txt | 1 - analysis/PWGC2F/flow/CMakeLists.txt | 53 -- .../flow/DataTreeCbmInterface/CMakeLists.txt | 86 --- .../DataTreeCbmInterface.cxx | 705 ------------------ .../DataTreeCbmInterface.h | 106 --- .../DataTreeCbmInterfaceLinkDef.h | 22 - .../DataTreeCbmInterface/PsdModulesPosition.h | 37 - .../flow/DataTreeCbmInterface/README.md | 2 - .../macro/run_treemaker.C | 215 ------ external/.gitignore | 2 - external/CMakeLists.txt | 3 - external/InstallDataTree.cmake | 52 -- external/InstallDataTreeQA.cmake | 52 -- macro/C2F/CMakeLists.txt | 26 - 14 files changed, 1362 deletions(-) delete mode 100644 analysis/PWGC2F/flow/CMakeLists.txt delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/CMakeLists.txt delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.cxx delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.h delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterfaceLinkDef.h delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/PsdModulesPosition.h delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/README.md delete mode 100644 analysis/PWGC2F/flow/DataTreeCbmInterface/macro/run_treemaker.C delete mode 100644 external/InstallDataTree.cmake delete mode 100644 external/InstallDataTreeQA.cmake diff --git a/analysis/CMakeLists.txt b/analysis/CMakeLists.txt index 13e0bf3759..fa199975ce 100644 --- a/analysis/CMakeLists.txt +++ b/analysis/CMakeLists.txt @@ -6,7 +6,6 @@ add_subdirectory (PWGDIL/dielectron/lmvm) add_subdirectory (PWGDIL/dimuon) add_subdirectory (PWGC2F/femtoscopy/nicafemto) -add_subdirectory (PWGC2F/flow) add_subdirectory (PWGCHA/jpsi) diff --git a/analysis/PWGC2F/flow/CMakeLists.txt b/analysis/PWGC2F/flow/CMakeLists.txt deleted file mode 100644 index a4d655c476..0000000000 --- a/analysis/PWGC2F/flow/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -add_subdirectory (DataTreeCbmInterface) - - -#set(UNIGENQA_VERSION "1.0") -#set(UNIGENQA_SRC_URL "https://cbmgsi.githost.io/pwg-c2f/UnigenQA.git") -#set(UNIGENQA_DESTDIR "${CMAKE_BINARY_DIR}/analysis/flow/UNIGENQA-prefix") -#set(UNIGENQA_LIBNAME "${CMAKE_SHARED_LIBRARY_PREFIX}UnigenQA${CMAKE_SHARED_LIBRARY_SUFFIX}") - -#download_project(PROJ UnigenQA_source -# GIT_REPOSITORY ${UNIGENQA_SRC_URL} -# GIT_TAG ${UNIGENQA_VERSION} -# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/UnigenQA -#) - - -#If(ProjectUpdated) -# File(REMOVE_RECURSE ${UNIGENQA_DESTDIR}) -# Message("UnigenQA source directory was changed so build directory was deleted") -#EndIf() - -#ExternalProject_Add(UNIGENQA -# BUILD_IN_SOURCE 0 -# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/UnigenQA -# BUILD_BYPRODUCTS ${UNIGENQA_LIBRARY} -# LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 -# CMAKE_ARGS -G ${CMAKE_GENERATOR} -# -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -# -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -# -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -# -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -# -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -# -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} -# -DFIXTARGET=TRUE -# -DROOTSYS=${SIMPATH} -# -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -# INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install -#) - -#add_library(UnigenQA SHARED IMPORTED) -#set_target_properties(UnigenQA PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib) -#add_dependencies(UnigenQA UNIGENQA) - -#set(UnigenQA_LIB_DIR ${CMAKE_BINARY_DIR}/lib) -#set(UnigenQA_LIBRARIES UnigenQA) -#set(UnigenQA_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") -#set(UnigenQA_FOUND TRUE) - -#Install(FILES ${CMAKE_BINARY_DIR}/lib/${UNIGENQA_LIBNAME} -# ${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}UnigenQA.rootmap -# ${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}UnigenQA_rdict.pcm -# DESTINATION lib -# ) - diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/CMakeLists.txt b/analysis/PWGC2F/flow/DataTreeCbmInterface/CMakeLists.txt deleted file mode 100644 index 100acf5226..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/CMakeLists.txt +++ /dev/null @@ -1,86 +0,0 @@ -Set(INCLUDE_DIRECTORIES - - ${CMAKE_CURRENT_SOURCE_DIR} - - ${CBMBASE_DIR} - - ${CBMDATA_DIR} - ${CBMDATA_DIR}/base - ${CBMDATA_DIR}/sts - ${CBMDATA_DIR}/global - ${CBMDATA_DIR}/psd - ${CBMDATA_DIR}/tof - - ${CBMROOT_SOURCE_DIR}/generators - - ${CBMROOT_SOURCE_DIR}/reco/KF - ${CBMROOT_SOURCE_DIR}/reco/KF/Interface - ${CBMROOT_SOURCE_DIR}/reco/KF/KFQA - - ${CBMROOT_SOURCE_DIR}/reco/L1 - ${CBMROOT_SOURCE_DIR}/reco/L1/L1Algo - ${CBMROOT_SOURCE_DIR}/reco/L1/ParticleFinder -) - -Include_Directories (${INCLUDE_DIRECTORIES}) - -Set(SYSTEM_INCLUDE_DIRECTORIES - ${VC_INCLUDE_DIRS} - ${BASE_INCLUDE_DIRECTORIES} - ${Boost_INCLUDE_DIR} - ${KFParticle_INCLUDE_DIR} - ${DataTree_INCLUDE_DIR} -) - -Include_Directories (SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES}) - -set (LINK_DIRECTORIES - ${ROOT_LIBRARY_DIR} - ${FAIRROOT_LIBRARY_DIR} - ${Boost_LIBRARY_DIRS} - ${Vc_LIB_DIR} - ${KFParticle_LIB_DIR} - ${DataTree_LIB_DIR} -) - -link_directories( ${LINK_DIRECTORIES}) - -set (SRCS - DataTreeCbmInterface.cxx -) - -set (HEADERS - DataTreeCbmInterface.h -) - -IF (SSE_FOUND) - Message(STATUS "DataTreeCbmInterface will be compiled with SSE support") - ADD_DEFINITIONS(-DHAVE_SSE) - SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS - "-msse -O3") -ELSE (SSE_FOUND) - MESSAGE(STATUS "DataTreeCbmInterface will be compiled without SSE support") - SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS - "-O3") -ENDIF (SSE_FOUND) - -Set(LINKDEF DataTreeCbmInterfaceLinkDef.h) -Set(LIBRARY_NAME DataTreeCbmInterface) - -Set(_DataTree_LIB DataTree) - -Set(DEPENDENCIES - ${_DataTree_LIB} - CbmData - CbmBase - CbmSimGenerators - KF - L1 - Vc.a) -Set(DEFINITIONS -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS -DDATATREE_CBM) - -ADD_DEFINITIONS(${DEFINITIONS}) - -GENERATE_LIBRARY() - -Add_Dependencies(DataTreeCbmInterface DATATREE) diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.cxx b/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.cxx deleted file mode 100644 index 6bf15c9bc5..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.cxx +++ /dev/null @@ -1,705 +0,0 @@ -//TODO runid, eventid, vertex, fitter!, match in STS, constants - -#include "DataTreeCbmInterface.h" -#include <fstream> -#include <iostream> -#include <vector> -using std::cout; -using std::endl; -using std::ifstream; -using std::vector; - -#include "TDirectory.h" -#include "TROOT.h" - -#include "CbmDigiManager.h" -#include "CbmGlobalTrack.h" -#include "CbmMCTrack.h" -#include "CbmPsdDigi.h" -#include "CbmPsdHit.h" -#include "CbmPsdPoint.h" -#include "CbmStsTrack.h" -#include "CbmTofHit.h" -#include "CbmTrackMatchNew.h" -// #include "CbmTrackMatch.h" - -#include "FairMCEventHeader.h" - -//L1Algo tools -// #include "CbmL1.h" -// #include "L1Algo.h" -// #include "CbmL1Track.h" -// #include "L1TrackPar.h" -// #include "L1Station.h" -// #include "L1Extrapolation.h" -// #include "L1AddMaterial.h" -// #include "L1Filtration.h" -// #include "L1MaterialInfo.h" -#include "CbmKFTrack.h" -#include "CbmL1PFFitter.h" - -#include "CbmKFVertex.h" -#include "KFParticleTopoReconstructor.h" -#include "L1Field.h" - -#include "DataTreeConstants.h" -#include "DataTreeEvent.h" -#include "DataTreeTrack.h" - -#include <TGeoBBox.h> - -//=================================================================> MAIN <=============================================================== -DataTreeCbmInterface::DataTreeCbmInterface() - : FairTask("DataTreeCbmInterface", 1) { - fDTEvent = new DataTreeEvent(); -} -DataTreeCbmInterface::~DataTreeCbmInterface() {} - - -//=================================================================> INIT <=============================================================== -//---------------------------------- -InitStatus DataTreeCbmInterface::Init() { - InitInput(); - InitOutput(); - return kSUCCESS; -} - - -void DataTreeCbmInterface::LoadGeo(const TString& geoFile) { - const char* fairGeom = "FAIRGeom"; - const char* moduleNamePrefix = "module"; - - TGeoManager* geoMan = TGeoManager::Import(geoFile.Data(), fairGeom); - TGeoNode* caveNode = geoMan->GetTopNode(); - TGeoNode* psdNode = nullptr; - TString nodeName; - - for (int i = 0; i < caveNode->GetNdaughters(); i++) { - psdNode = caveNode->GetDaughter(i); - nodeName = psdNode->GetName(); - if (nodeName.Contains("psd")) break; - } - std::cout << "-I- " << psdNode->GetName() << std::endl; - - auto psdGeoMatrix = psdNode->GetMatrix(); - auto psdBox = (TGeoBBox*) psdNode->GetVolume()->GetShape(); - TVector3 frontFaceLocal(0, 0, -psdBox->GetDZ()); - - TVector3 frontFaceGlobal; - psdGeoMatrix->LocalToMaster(&frontFaceLocal[0], &frontFaceGlobal[0]); - - fPsdPosition = frontFaceGlobal; - - fPsdModules = 0; - fPsdModulePositions.clear(); - for (int i_d = 0; i_d < psdNode->GetNdaughters(); ++i_d) { - auto* daughter = psdNode->GetDaughter(i_d); - TString daughterName(daughter->GetName()); - if (daughterName.BeginsWith(moduleNamePrefix)) { - - auto geoMatrix = daughter->GetMatrix(); - TVector3 translation(geoMatrix->GetTranslation()); - - int modID = daughter->GetNumber(); - double x = translation.X(); - double y = translation.Y(); - - std::cout << "mod" << modID << " : " << Form("(%.3f, %3f)", x, y) - << std::endl; - fPsdModulePositions.insert({modID, translation}); - fPsdModules++; - } - } - std::cout << "-I- Number of PSD modules: " << fPsdModules << std::endl; - // Fix to avoid crash - if (gROOT->GetVersionInt() >= 60602) { - geoMan->GetListOfVolumes()->Delete(); - geoMan->GetListOfShapes()->Delete(); - } - delete geoMan; -} - - -//---------------------------------- -void DataTreeCbmInterface::InitInput() { - FairRootManager* ioman = FairRootManager::Instance(); - fPrimVtx = (CbmVertex*) ioman->GetObject("PrimaryVertex."); - if (!fPrimVtx) fPrimVtx = (CbmVertex*) ioman->GetObject("PrimaryVertex."); - fHeader = (FairMCEventHeader*) ioman->GetObject("MCEventHeader."); - flistPSDhit = (TClonesArray*) ioman->GetObject("PsdHit"); - flistMCtrack = (TClonesArray*) ioman->GetObject("MCTrack"); - flistSTSRECOtrack = (TClonesArray*) ioman->GetObject("StsTrack"); - flistSTStrackMATCH = (TClonesArray*) ioman->GetObject("StsTrackMatch"); - fGlobalTrackArray = (TClonesArray*) ioman->GetObject("GlobalTrack"); - fTofHitArray = (TClonesArray*) ioman->GetObject("TofHit"); - fTofHitMatchArray = (TClonesArray*) ioman->GetObject("TofHitMatch"); - fPsdPointArray = (TClonesArray*) ioman->GetObject("PsdPoint"); - fDigiMan = CbmDigiManager::Instance(); - fDigiMan->Init(); -} - -//---------------------------------- -void DataTreeCbmInterface::InitOutput() { InitOutputTree(); } - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::InitDataTreeEvent() { - for (int i = 0; i < fPsdModules; ++i) - fDTEvent->AddPSDModule(10); -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::InitOutputTree() { - fTreeFile = new TFile(fOutputFileName, "RECREATE"); - fTreeFile->cd(); - fDataTree = new TTree("DataTree", "DataTree"); - fDataTree->Branch("DTEvent", &fDTEvent); -} - -//=================================================================> EXEC <=============================================================== -void DataTreeCbmInterface::Exec(Option_t*) { - ClearEvent(); - - InitDataTreeEvent(); - ReadEvent(); - ReadPSD(); - ReadMC(); - ReadTracks(); - // LinkSTS(); - ReadV0(0); - ReadV0(1); - ReadTOF(); - if (fPsdModules == 0) ReadPsdPrimaryParticles(); - - fDataTree->Fill(); -} -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ClearEvent() { - fMCTrackIDs.clear(); - fTrackIDs.clear(); - fDTEvent->ClearEvent(); -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadEvent() { - if (!fHeader) { - cout << "No fHeader!" << endl; - return; - } - - fDTEvent->SetRPAngle(fHeader->GetRotZ()); - fDTEvent->SetImpactParameter(fHeader->GetB()); - fDTEvent->SetRunId(fHeader->GetRunID()); - fDTEvent->SetEventId(fHeader->GetEventID()); - fDTEvent->SetMCVertexPosition( - fHeader->GetX(), fHeader->GetY(), fHeader->GetZ()); - if (!fPrimVtx) { - if (fPsdModules != 0) cout << "No fPrimVtx!" << endl; - return; - } else { - fDTEvent->SetVertexPosition( - fPrimVtx->GetX(), fPrimVtx->GetY(), fPrimVtx->GetZ()); - fDTEvent->SetVertexQuality(fPrimVtx->GetChi2() / fPrimVtx->GetNDF(), 0); - } - - // KFParticle KFParticle_vtx_TOF = fFinderTOF->GetTopoReconstructor()->GetPrimVertex(0); - // fDTEvent -> SetVertexPosition (KFParticle_vtx_TOF.X(), KFParticle_vtx_TOF.Y(), KFParticle_vtx_TOF.Z(), 0); - // fDTEvent -> SetVertexQuality (KFParticle_vtx_TOF.Chi2() / KFParticle_vtx_TOF.NDF(), 0); - // KFParticle KFParticle_vtx_MC = fFinderMC->GetTopoReconstructor()->GetPrimVertex(0); - // fDTEvent -> SetVertexPosition (KFParticle_vtx_MC.X(), KFParticle_vtx_MC.Y(), KFParticle_vtx_MC.Z(), 1); - // fDTEvent -> SetVertexQuality (KFParticle_vtx_MC.Chi2() / KFParticle_vtx_MC.NDF(), 1); -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadPSD() { - if (!flistPSDhit) return; - const int nPSDhits = flistPSDhit->GetEntriesFast(); - - for (int i = 0; i < fPsdModules; ++i) { - fDTEvent->GetPSDModule(i)->SetPosition(fPsdModulePositions[i].X(), - fPsdModulePositions[i].Y(), - fPsdModulePositions[i].Z()); - } - - CbmPsdHit* hit {nullptr}; - Float_t PsdEnergy {0.}; - - for (int i = 0; i < nPSDhits; ++i) { - hit = (CbmPsdHit*) flistPSDhit->At(i); - if (hit == nullptr) continue; - fDTEvent->GetPSDModule(hit->GetModuleID() - 1)->SetEnergy(hit->GetEdep()); - PsdEnergy += hit->GetEdep(); - } - - fDTEvent->SetPsdEnergy(PsdEnergy); - fDTEvent->SetPsdPosition( - fPsdPosition.X(), fPsdPosition.Y(), fPsdPosition.Z()); - - const int nPSDdigits = fDigiMan->GetNofDigis(ECbmModuleId::kPsd); - const CbmPsdDigi* digit {nullptr}; - for (int i = 0; i < nPSDdigits; ++i) { - digit = fDigiMan->Get<CbmPsdDigi>(i); - if (digit == nullptr) continue; - fDTEvent->GetPSDModule(digit->GetModuleID() - 1) - ->GetSection(digit->GetSectionID() - 1) - ->AddEnergy(digit->GetEdep()); - } -} -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadPsdPrimaryParticles() { - Int_t nPoints = fPsdPointArray->GetEntriesFast(); - for (Int_t iPoint = 0; iPoint < nPoints; iPoint++) { - CbmPsdPoint* point = (CbmPsdPoint*) fPsdPointArray->At(iPoint); - if (!point) { - cout << "No PSD point number " << iPoint << endl; - continue; - } - CbmMCTrack* mctrack = (CbmMCTrack*) flistMCtrack->At(point->GetTrackID()); - if (!mctrack) - cout << "No MC track number " << point->GetTrackID() - << "matched to PSD point number " << iPoint << endl; - float mass; - const long int type = mctrack->GetPdgCode(); - if (type < 10000) - mass = mctrack->GetMass(); - else - mass = (type / 10 % 1000) * 0.931; - TLorentzVector momentum; - momentum.SetXYZM(point->GetPx(), point->GetPy(), point->GetPz(), mass); - TVector3 position(point->GetX(), point->GetY(), point->GetZ()); - - DataTreePSDPrimaryParticle* psdParticle = fDTEvent->AddPSDPrimaryParticle(); - psdParticle->SetMomentum(momentum); - psdParticle->SetPosition(position); - psdParticle->SetPdgID(mctrack->GetPdgCode()); - psdParticle->SetType(mctrack->GetMotherId()); - } -} - -//-------------------------------------------------------------------------------------------------- -int DataTreeCbmInterface::GetMCTrackMatch(const int idx) { - for (int i = 0; i < fDTEvent->GetNTracks(); ++i) - if (fDTEvent->GetTrack(i)->GetMCTrackId() == idx) return i; - return EnumGlobalConst::kUndefinedValue; -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadMC() { - if (!flistMCtrack) return; - CbmMCTrack* mctrack {nullptr}; - Float_t mass {0.}; - Int_t charge {0}; - TLorentzVector mom; - - const int nTracks = flistMCtrack->GetEntries(); - - for (int i = 0; i < nTracks; ++i) { - mctrack = (CbmMCTrack*) flistMCtrack->At(i); - const int motherid = mctrack->GetMotherId(); - // if (motherid != -1) continue; - - const long int type = mctrack->GetPdgCode(); - if (type < 1000000000) { - charge = mctrack->GetCharge() / 3; - mass = mctrack->GetMass(); - } else { - //pdg = 1000000000 + 10*1000*z + 10*a + i; - charge = type / 10000 % 1000; - mass = (type / 10 % 1000) * 0.931; - } - - mom.SetXYZM(mctrack->GetPx(), mctrack->GetPy(), mctrack->GetPz(), mass); - - fMCTrackIDs.push_back(i); - fDTEvent->AddMCTrack(); - DataTreeMCTrack* DTMCTrack = fDTEvent->GetLastMCTrack(); - - DTMCTrack->SetMomentum(mom); - DTMCTrack->SetCharge(charge); - - DTMCTrack->SetPdgId(type); - DTMCTrack->SetMotherId(motherid); - - // std::cout << GetMCTrackMatch(i) << std::endl; - // DTMCTrack->SetRecoTrackId( {GetMCTrackMatch(i)} ); - } -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadTracks() { - if (!flistSTSRECOtrack) return; - std::cout << "ReadTracks" << std::endl; - - const Float_t mass = 0.14; // pion mass assumption to write TLorentzVector - - const Int_t nSTStracks = flistSTSRECOtrack->GetEntries(); - - int nMCtracks = fDTEvent->GetNMCTracks(); - - for (Int_t i = 0; i < nSTStracks; ++i) { - CbmStsTrack* track {nullptr}; - CbmTrackMatchNew* match {nullptr}; - Int_t mcTrackID {-999}; - // CbmMCTrack* mctrack{nullptr}; (FU) unused - DataTreeTrack* DTTrack {nullptr}; - DataTreeTrack* DTVertexTrack {nullptr}; - const FairTrackParam* trackParam {nullptr}; - DataTreeTrackParams Params; - TVector3 momRec; - TLorentzVector mom; - // std::cout << "i = " << i << std::endl; - track = (CbmStsTrack*) flistSTSRECOtrack->At(i); - - if (track == nullptr) { - cout << "ERROR: empty track!"; - continue; - } - - fDTEvent->AddTrack(); - - trackParam = track->GetParamFirst(); - trackParam->Momentum(momRec); - const Int_t q = trackParam->GetQp() > 0 ? 1 : -1; - - mom.SetXYZM(momRec.X(), momRec.Y(), momRec.Z(), mass); - - DTTrack = fDTEvent->GetLastTrack(); - - DTTrack->SetMomentum(mom); - DTTrack->SetId(i); - DTTrack->SetNumberOfHits(track->GetNofHits(), 0); - DTTrack->SetFlag(track->GetFlag()); - DTTrack->SetChi2(track->GetChiSq()); - DTTrack->SetNDF(track->GetNDF()); - DTTrack->SetCharge(q); - - Params.SetMagFieldFit(0., 0., 0., 0., 0., 0., 0., 0., 0., 0.); - - std::vector<double> trackParametersValuesT = {trackParam->GetX(), - trackParam->GetY(), - trackParam->GetZ(), - trackParam->GetTx(), - trackParam->GetTy(), - trackParam->GetQp()}; - - std::vector<double> covMatrixValuesT(25, 0.); - - // if (i==0) - // std::cout << "V: before " << momRec.X() << std::endl; - - Params.SetParameters(trackParametersValuesT); - Params.SetCovMatrix(covMatrixValuesT); - Params.SetPosition( - trackParam->GetX(), trackParam->GetY(), trackParam->GetZ()); - DTTrack->SetParams(Params, EnumParamsPoint::kVertex); - - fTrackIDs.push_back(i); - - - // // // // // // // // // // // // // // // // // // // // // // // - // Vertex tracks - // // // // // // // // // // // // // // // // // // // // // // // - - vector<CbmStsTrack> vRTracks(1); - vRTracks[0] = *track; - CbmL1PFFitter fitter; - vector<float> vChiToPrimVtx; - - if (!fPrimVtx) continue; - - // CbmKFTrack kftrack(vRTracks[0]); - // kftrack.Extrapolate(fPrimVtx->GetZ()); - - vector<L1FieldRegion> vField; - CbmKFVertex kfVertex = CbmKFVertex(*fPrimVtx); - std::vector<int> pdg = {211}; - fitter.Fit(vRTracks, pdg); - fitter.GetChiToVertex(vRTracks, vField, vChiToPrimVtx, kfVertex, 100000.); - - // if (i==0) - { - // std::cout << vField.at(0).cx0 << " " << vField.at(0).cx1 << " " << vField.at(0).cx2 << std::endl; - // std::cout << vField.at(0).cy0 << " " << vField.at(0).cy1 << " " << vField.at(0).cy2 << std::endl; - // std::cout << vField.at(0).cz0 << " " << vField.at(0).cz1 << " " << vField.at(0).cz2 << std::endl; - // std::cout << vField.at(0).z0 << std::endl; - } - - fDTEvent->AddVertexTrack(); - // - //BEGIN vertex point - - track = &(vRTracks[0]); - - trackParam = track->GetParamFirst(); - trackParam->Momentum(momRec); - - //const float xyz[] = {0.,0.,0.}; - //CbmKFParticle tmpPart(kftrack); - //tmpPart.TransportToPoint(xyz); - - - // if (i==0) - // std::cout << "V: after 1 " << momRec.X() << std::endl; - //std::cout << "V: after 2 " << kftrack.GetTrack()[2] << std::endl; - - mom.SetXYZM(momRec.X(), momRec.Y(), momRec.Z(), mass); - - DTVertexTrack = fDTEvent->GetLastVertexTrack(); - DTVertexTrack->SetId(i); - DTVertexTrack->SetMomentum(mom); - DTVertexTrack->SetFlag(track->GetFlag()); - DTVertexTrack->SetChi2(track->GetChiSq()); - DTVertexTrack->SetNDF(track->GetNDF()); - DTVertexTrack->SetNumberOfHits(track->GetNofHits(), 0); - DTVertexTrack->SetCharge(q); - DTVertexTrack->SetDCA(trackParam->GetX() - fPrimVtx->GetX(), - trackParam->GetY() - fPrimVtx->GetY(), - trackParam->GetZ() - fPrimVtx->GetZ()); - - Params.SetMagFieldFit(float(vField.at(0).cx0[0]), - float(vField.at(0).cx1[0]), - float(vField.at(0).cx2[0]), - float(vField.at(0).cy0[0]), - float(vField.at(0).cy1[0]), - float(vField.at(0).cy2[0]), - float(vField.at(0).cz0[0]), - float(vField.at(0).cz1[0]), - float(vField.at(0).cz2[0]), - float(vField.at(0).z0[0])); - - std::vector<double> trackParametersValues = {trackParam->GetX(), - trackParam->GetY(), - trackParam->GetZ(), - trackParam->GetTx(), - trackParam->GetTy(), - trackParam->GetQp()}; - - DTVertexTrack->SetVtxChi2(vChiToPrimVtx[0]); - - std::vector<double> covMatrixValues(25, 0.); - - Params.SetParameters(trackParametersValues); - Params.SetCovMatrix(covMatrixValues); - Params.SetPosition( - trackParam->GetX(), trackParam->GetY(), trackParam->GetZ()); - - DTVertexTrack->SetParams(Params, EnumParamsPoint::kVertex); - match = (CbmTrackMatchNew*) flistSTStrackMATCH->At(i); - if (match->GetNofLinks() > 0) { - mcTrackID = match->GetMatchedLink().GetIndex(); - if (mcTrackID >= 0 && mcTrackID < nMCtracks) { - fDTEvent->AddTrackMatch(DTVertexTrack, fDTEvent->GetMCTrack(mcTrackID)); - DTVertexTrack->SetMCTrackId(mcTrackID); - } - // else - // { - // cout << "Reco id = " << i; - // cout << "\tMC id = " << mcTrackID; - // cout << "\tnMCtracks = " << nMCtracks << endl; - // } - } - } -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::LinkSTS() { - bool found = false; - // std::cout << "==================== MC" << std::endl; - - for (int i = 0; i < fDTEvent->GetNTracks(); ++i) { - found = false; - int j {0}; - for (; j < fDTEvent->GetNMCTracks() && !found; j++) { - // std::cout<<j<<" "<<fMCTrackIDs.at(j)<<" " <<fDTEvent->GetTrack(i)->GetMCTrackId()<<" "<<fDTEvent->GetMCTrack(j)->GetId() <<std::endl; - if (fMCTrackIDs.at(j) == fDTEvent->GetTrack(i)->GetMCTrackId()) { - // std::cout<<"track id: "<<i<<"; before: " << fDTEvent->GetTrack(i)->GetMCTrackId()<<"; after: "<<j << std::endl; - found = true; - fDTEvent->GetTrack(i)->SetMCTrackId(j); - break; - } - } - if (found) { - fDTEvent->AddTrackMatch(fDTEvent->GetTrack(i), fDTEvent->GetMCTrack(j)); - } else { - fDTEvent->GetTrack(i)->SetMCTrackId(EnumGlobalConst::kUndefinedValue); - } - } -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadTOF() { - if (!fGlobalTrackArray) return; - std::cout << "ReadTOF" << std::endl; - - for (Int_t igt = 0; igt < fGlobalTrackArray->GetEntries(); igt++) { - const CbmGlobalTrack* globalTrack = - static_cast<const CbmGlobalTrack*>(fGlobalTrackArray->At(igt)); - - const Int_t stsTrackIndex = globalTrack->GetStsTrackIndex(); - if (stsTrackIndex < 0) continue; - - CbmStsTrack* cbmStsTrack = - (CbmStsTrack*) flistSTSRECOtrack->At(stsTrackIndex); - const Int_t tofHitIndex = globalTrack->GetTofHitIndex(); - - if (tofHitIndex < 0) continue; - - const CbmTofHit* tofHit = - static_cast<const CbmTofHit*>(fTofHitArray->At(tofHitIndex)); - if (!tofHit) continue; - - const FairTrackParam* globalPar = globalTrack->GetParamLast(); - TVector3 mom; - cbmStsTrack->GetParamFirst()->Momentum(mom); - - const Float_t p = mom.Mag(); - const Int_t q = globalPar->GetQp() > 0 ? 1 : -1; - const Float_t l = - globalTrack->GetLength(); // l is calculated by global tracking - - const Float_t time = tofHit->GetTime(); - const Float_t m2 = - p * p - * (1. / ((l / time / SpeedOfLight) * (l / time / SpeedOfLight)) - 1.); - const Float_t hitX = tofHit->GetX(); - const Float_t hitY = tofHit->GetY(); - const Float_t hitZ = tofHit->GetZ(); - - const Float_t Tx = globalPar->GetTx(); - const Float_t Ty = globalPar->GetTy(); - const Float_t trackZ = globalPar->GetZ(); - const Float_t dz = hitZ - trackZ; - - const Float_t trackX = - globalPar->GetX() + Tx * dz; //extrapolation to TOF hit - const Float_t trackY = globalPar->GetY() + Ty * dz; - - DataTreeTOFHit* DTTOFHit = fDTEvent->AddTOFHit(); - DTTOFHit->SetId(tofHitIndex); - DTTOFHit->SetPosition(hitX, hitY, hitZ); - DTTOFHit->SetTime(time); - DTTOFHit->SetPathLength(l); - DTTOFHit->SetCharge(q); - DTTOFHit->SetSquaredMass(m2); - - - Int_t iTrk = 0; - for (; iTrk < fDTEvent->GetNTracks(); iTrk++) { - if (stsTrackIndex >= 0 - && fDTEvent->GetTrack(iTrk)->GetId() == UInt_t(stsTrackIndex)) - break; - } - if (iTrk == fDTEvent->GetNTracks()) continue; - - DTTOFHit->AddRecoTrackId(iTrk); - - DataTreeTrackParams par; - par.SetPosition(trackX, trackY, hitZ); //extrapolated to hit - - // std::cout << "X : " << hitX << " " << globalPar->GetX() << " " << trackX << std::endl; - // std::cout << "Z : " << hitZ << " " << trackZ << " " << Tx * dz << std::endl; - - DataTreeTrack* track = fDTEvent->GetTrack(iTrk); - track->SetLength(l); - track->SetTOFHitId(fDTEvent->GetNTOFHits() - 1); - track->SetParams(par, EnumParamsPoint::kTof); - - DataTreeTrack* vtrack = fDTEvent->GetVertexTrack(iTrk); - vtrack->SetLength(l); - vtrack->SetTOFHitId(fDTEvent->GetNTOFHits() - 1); - vtrack->SetParams(par, EnumParamsPoint::kTof); - } -} - -//-------------------------------------------------------------------------------------------------- -void DataTreeCbmInterface::ReadV0(const int UseMCpid) { - const KFParticleTopoReconstructor* topo_rec; - if (UseMCpid) topo_rec = fFinderMC->GetTopoReconstructor(); - if (!UseMCpid) topo_rec = fFinderTOF->GetTopoReconstructor(); - - if (!topo_rec) { - cout - << "DataTreeCbmInterface::ReadV0: ERROR: no KFParticleTopoReconstructor!" - << endl; - return; - } - TLorentzVector mom; - - // cout << "DataTreeCbmInterface::ReadV0 1" << endl; - - const int ConstNV0Types = fDTEvent->GetNV0Types(); - - int V0Mult[ConstNV0Types]; - for (int i = 0; i < ConstNV0Types; ++i) { - V0Mult[i] = 0; - } - - for (unsigned int iP = 0; iP < topo_rec->GetParticles().size(); iP++) { - bool accept_V0 = false; - for (int i = 0; i < ConstNV0Types; ++i) { - if (topo_rec->GetParticles()[iP].GetPDG() == fDTEvent->GetNV0Pdg(i)) { - accept_V0 = true; - V0Mult[i]++; - } - } - if (!accept_V0) continue; - - const KFParticle& V0 = topo_rec->GetParticles()[iP]; - DataTreeV0Candidate* V0Candidate; - if (!UseMCpid) { V0Candidate = fDTEvent->AddV0CandidateTOFpid(); } - if (UseMCpid) { V0Candidate = fDTEvent->AddV0CandidateMCpid(); } - if (!V0Candidate) - cout << "DataTreeCbmInterface::ReadV0_TOF: ERROR: no V0Candidate!" - << endl; - - mom.SetXYZM(V0.GetPx(), V0.GetPy(), V0.GetPz(), V0.GetMass()); - - V0Candidate->SetMomentum(mom); - V0Candidate->SetPdgId(V0.GetPDG()); - V0Candidate->SetChi2(V0.GetChi2()); - V0Candidate->SetCharge((int) V0.GetQ()); - - if (V0.NDaughters() != 2) { - printf("Number of daughters not %d (%d)!\n", 2, V0.NDaughters()); - continue; - } - - for (int iDaughter = 0; iDaughter < V0.NDaughters(); iDaughter++) { - const int daugherIndex = V0.DaughterIds()[iDaughter]; - const KFParticle& daughter = topo_rec->GetParticles()[daugherIndex]; - - V0Candidate->AddDaughter(); - DataTreeV0Candidate* Daughter = V0Candidate->GetDaughter(iDaughter); - - mom.SetXYZM(daughter.GetPx(), - daughter.GetPy(), - daughter.GetPz(), - daughter.GetMass()); - - Daughter->SetMomentum(mom); - Daughter->SetPdgId(daughter.GetPDG()); - Daughter->SetChi2(daughter.GetChi2()); - if (daughter.NDaughters() == 1) { - Daughter->SetTrackId(daughter.DaughterIds()[0]); - } - } - } - int V0Mult_All = 0; - for (int i = 0; i < ConstNV0Types; ++i) { - if (!UseMCpid) { fDTEvent->SetNV0SpecificCandidatesTOFpid(i, V0Mult[i]); } - if (UseMCpid) { fDTEvent->SetNV0SpecificCandidatesMCpid(i, V0Mult[i]); } - V0Mult_All += V0Mult[i]; - } - - if (!UseMCpid) { fDTEvent->SetNV0CandidatesTOFpid(V0Mult_All); } - if (UseMCpid) { fDTEvent->SetNV0CandidatesMCpid(V0Mult_All); } -} - -//================================================================> FINISH <============================================================== -void DataTreeCbmInterface::Finish() { - cout << "DataTreeCbmInterface::Finish" << endl; - fDataTree->Write(); - fTreeFile->Write(); - fTreeFile->Close(); -} - -ClassImp(DataTreeCbmInterface) diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.h b/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.h deleted file mode 100644 index e6bc5e3947..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterface.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef DataTreeCbmInterface_H -#define DataTreeCbmInterface_H 1 - -#include "CbmKFPartEfficiencies.h" -#include "CbmKFParticleFinder.h" - -#include "CbmVertex.h" -#include "FairTask.h" -#include "TLorentzVector.h" -#include <cstring> -#include <map> -#include <vector> - -#include "FairMCEventHeader.h" -#include "TCanvas.h" -#include "TClonesArray.h" -#include "TFile.h" -#include "TGraphErrors.h" -#include "TH2F.h" -#include "TProfile.h" -#include <TGeoManager.h> -#include <iostream> - -#include "CbmKFVertex.h" -#include "CbmTrackMatch.h" - -class DataTreeEvent; -class TClonesArray; -class CbmVertex; -class TDirectory; -class TH1F; -class TProfile; -class TH2F; -class CbmDigiManager; - - -class DataTreeCbmInterface : public FairTask { - -public: - DataTreeCbmInterface(); - ~DataTreeCbmInterface(); - - virtual InitStatus Init(); - virtual void Exec(Option_t* opt); - virtual void Finish(); - - void SetOutputFile(const TString filename) { fOutputFileName = filename; } - - void LoadGeo(const TString& geoFile); - - void SetKFParticleFinderTOF(const CbmKFParticleFinder* finder) { - fFinderTOF = finder; - } - void SetKFParticleFinderMC(const CbmKFParticleFinder* finder) { - fFinderMC = finder; - } - -private: - void InitInput(); - void InitOutput(); - void InitOutputTree(); - void InitDataTreeEvent(); - void ClearEvent(); - void ReadEvent(); - void ReadPSD(); - void ReadTracks(); - void LinkSTS(); - void ReadTOF(); - void ReadMC(); - int GetMCTrackMatch(const int idx); - void ReadV0(const int UseMCpid = 0); - void ReadPsdPrimaryParticles(); - - TString fOutputFileName {""}; - TFile* fTreeFile {nullptr}; - TTree* fDataTree {nullptr}; - - CbmVertex* fPrimVtx {nullptr}; - FairMCEventHeader* fHeader {nullptr}; - CbmDigiManager* fDigiMan {nullptr}; - TClonesArray* flistPSDhit {nullptr}; - TClonesArray* flistMCtrack {nullptr}; - TClonesArray* flistSTSRECOtrack {nullptr}; - TClonesArray* flistSTStrackMATCH {nullptr}; - TClonesArray* fGlobalTrackArray {nullptr}; - TClonesArray* fTofHitArray {nullptr}; - TClonesArray* fTofHitMatchArray {nullptr}; - TClonesArray* fPsdPointArray {nullptr}; - - DataTreeEvent* fDTEvent {nullptr}; - - int fPsdModules {0}; - TVector3 fPsdPosition; - std::map<int, TVector3> fPsdModulePositions; - - - std::vector<int> fMCTrackIDs; - std::vector<int> fTrackIDs; - - const CbmKFParticleFinder* fFinderTOF {nullptr}; - const CbmKFParticleFinder* fFinderMC {nullptr}; - - ClassDef(DataTreeCbmInterface, 1) -}; - -#endif diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterfaceLinkDef.h b/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterfaceLinkDef.h deleted file mode 100644 index f4cfda3642..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/DataTreeCbmInterfaceLinkDef.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifdef __CINT__ - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#pragma link C++ class DataTreeCbmInterface + ; - -//#pragma link C++ class DataTreeEvent+; -//#pragma link C++ class DataTreeTrack+; -//#pragma link C++ class DataTreeTrackParams+; -//#pragma link C++ class DataTreePSDSection+; -//#pragma link C++ class DataTreePSDModule+; -//#pragma link C++ class DataTreeTOFHit+; -//#pragma link C++ class DataTreeV0Candidate+; -//#pragma link C++ class DataTreeMCTrack+; -//#pragma link C++ class DataTreeTrigger+; -//#pragma link C++ class DataTreeBPD+; -//#pragma link C++ class DataTreeWFA+; -//#pragma link C++ class DataTreeTrackMatch+; - -#endif diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/PsdModulesPosition.h b/analysis/PWGC2F/flow/DataTreeCbmInterface/PsdModulesPosition.h deleted file mode 100644 index 61076c50de..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/PsdModulesPosition.h +++ /dev/null @@ -1,37 +0,0 @@ -const std::vector<float> Psd44PositionX = { - -70, -70, -70, -70, -50, -50, -50, -50, -50, -50, -30, -30, -30, -30, -30, - -30, -10, -10, -10, -10, -10, -10, 10, 10, 10, 10, 10, 10, 30, 30, - 30, 30, 30, 30, 50, 50, 50, 50, 50, 50, 70, 70, 70, 70}; - -const std::vector<float> Psd44PositionY = { - -30, -10, 10, 30, -50, -30, -10, 10, 30, 50, -50, -30, -10, 10, 30, - 50, -50, -30, -10, 10, 30, 50, -50, -30, -10, 10, 30, 50, -50, -30, - -10, 10, 30, 50, -50, -30, -10, 10, 30, 50, -30, -10, 10, 30}; - -const std::array<float, 46> Psd46PositionX = { - .0, 20.0, 20.0, 20.0, .0, -20.0, -20.0, -20.0, .0, 20.0, - 40.0, 40.0, 40.0, 40.0, 40.0, 20.0, .0, -20.0, -40.0, -40.0, - -40.0, -40.0, -40.0, -20.0, -60.0, -60.0, -60.0, -60.0, -60.0, 60.0, - 60.0, 60.0, 60.0, 60.0, .0, -20.0, 20.0, .0, -20.0, 20.0, - -80.0, -80.0, -80.0, 80.0, 80.0, 80.0}; - - -const std::array<float, 46> Psd46PositionY = { - 20.0, 20.0, .0, -20.0, -20.0, -20.0, .0, 20.0, 40.0, 40.0, - 40.0, 20.0, .0, -20.0, -40.0, -40.0, -40.0, -40.0, -40.0, -20.0, - .0, 20.0, 40.0, 40.0, -40.0, -20.0, .0, 20.0, 40.0, -40.0, - -20.0, .0, 20.0, 40.0, 60.0, 60.0, 60.0, -60.0, -60.0, -60.0, - .0, -20.0, 20.0, .0, -20.0, 20.0}; - - -const std::vector<float> Psd52PositionX = { - -15, -15, -15, -15, -5, -5, 5, 5, 15, 15, 15, 15, -70, - -70, -70, -70, -50, -50, -50, -50, -50, -50, -30, -30, -30, -30, - -30, -30, -10, -10, -10, -10, 10, 10, 10, 10, 30, 30, 30, - 30, 30, 30, 50, 50, 50, 50, 50, 50, 70, 70, 70, 70}; - -const std::vector<float> Psd52PositionY = { - -15, -5, 5, 15, -15, 15, -15, 15, -15, -5, 5, 15, -30, - -10, 10, 30, -50, -30, -10, 10, 30, 50, -50, -30, -10, 10, - 30, 50, -50, -30, 30, 50, -50, -30, 30, 50, -50, -30, -10, - 10, 30, 50, -50, -30, -10, 10, 30, 50, -30, -10, 10, 30}; diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/README.md b/analysis/PWGC2F/flow/DataTreeCbmInterface/README.md deleted file mode 100644 index f3450a9469..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# DataTreeCbmInterface - diff --git a/analysis/PWGC2F/flow/DataTreeCbmInterface/macro/run_treemaker.C b/analysis/PWGC2F/flow/DataTreeCbmInterface/macro/run_treemaker.C deleted file mode 100644 index 719423a293..0000000000 --- a/analysis/PWGC2F/flow/DataTreeCbmInterface/macro/run_treemaker.C +++ /dev/null @@ -1,215 +0,0 @@ -//#include "variables.h" //patch - -void run_treemaker(Int_t nEvents = 2, - TString dataSet = "test", - TString setupName = "sis100_electron") { - // ======================================================================== - // Adjust this part according to your requirements - - // --- Logger settings ---------------------------------------------------- - TString logLevel = "INFO"; - TString logVerbosity = "LOW"; - // ------------------------------------------------------------------------ - - - // ----- Environment -------------------------------------------------- - TString myName = "run_treemaker"; // this macro's name for screen output - TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory - TString paramDir = srcDir + "/parameters"; - // ------------------------------------------------------------------------ - - - // ----- In- and output file names ------------------------------------ - TString traFile = dataSet + ".tra.root"; - TString rawFile = dataSet + ".event.raw.root"; - TString recFile = dataSet + ".rec.root"; - TString geoFile = dataSet + ".geo.root"; - TString parFile = dataSet + ".par.root"; - TString outFile = dataSet + ".tree.root"; - TString KFeffFile = dataSet + ".KFeff.txt"; - TString KFqaFile = dataSet + ".KFQA.root"; - // ------------------------------------------------------------------------ - - - // ----- Load the geometry setup ------------------------------------- - std::cout << std::endl; - TString setupFile = srcDir + "/geometry/setup/setup_" + setupName + ".C"; - TString setupFunct = "setup_"; - setupFunct = setupFunct + setupName + "()"; - std::cout << "-I- " << myName << ": Loading macro " << setupFile << std::endl; - gROOT->LoadMacro(setupFile); - gROOT->ProcessLine(setupFunct); - CbmSetup* setup = CbmSetup::Instance(); - // You can modify the pre-defined setup by using - // CbmSetup::Instance()->RemoveModule(ESystemId) or - // CbmSetup::Instance()->SetModule(ESystemId, const char*, Bool_t) or - // CbmSetup::Instance()->SetActive(ESystemId, Bool_t) - // See the class documentation of CbmSetup. - // ------------------------------------------------------------------------ - - - // ----- Timer -------------------------------------------------------- - TStopwatch timer; - timer.Start(); - // ------------------------------------------------------------------------ - - - TString geoTag; - TList* parFileList = new TList(); - - std::cout << "-I- " << myName << ": Using raw file " << rawFile << std::endl; - std::cout << "-I- " << myName << ": Using parameter file " << parFile - << std::endl; - std::cout << "-I- " << myName << ": Using reco file " << recFile << std::endl; - std::cout << "-I- " << myName << ": Using geo file " << geoFile << std::endl; - - - // ----- Reconstruction run ------------------------------------------- - FairRunAna* run = new FairRunAna(); - FairFileSource* inputSource = new FairFileSource(recFile); - inputSource->AddFriend(traFile); - inputSource->AddFriend(rawFile); - run->SetSource(inputSource); - run->SetOutputFile(outFile); - run->SetGenerateRunInfo(kTRUE); - // ------------------------------------------------------------------------ - - - // ----- Mc Data Manager ------------------------------------------------ - CbmMCDataManager* mcManager = new CbmMCDataManager("MCManager", 1); - mcManager->AddFile(traFile); - run->AddTask(mcManager); - // ------------------------------------------------------------------------ - - // --- STS track matching ---------------------------------------------- - CbmMatchRecoToMC* matchTask = new CbmMatchRecoToMC(); - run->AddTask(matchTask); - // ------------------------------------------------------------------------ - - CbmKF* KF = new CbmKF(); - run->AddTask(KF); - - CbmL1* l1 = new CbmL1("CbmL1", 1, 3); - if (setup->IsActive(ECbmModuleId::kMvd)) { - setup->GetGeoTag(ECbmModuleId::kMvd, geoTag); - const TString mvdMatBudgetFileName = - srcDir + "/parameters/mvd/mvd_matbudget_" + geoTag + ".root"; - l1->SetMvdMaterialBudgetFileName(mvdMatBudgetFileName.Data()); - } - if (setup->IsActive(ECbmModuleId::kSts)) { - setup->GetGeoTag(ECbmModuleId::kSts, geoTag); - const TString stsMatBudgetFileName = - srcDir + "/parameters/sts/sts_matbudget_" + geoTag + ".root"; - l1->SetStsMaterialBudgetFileName(stsMatBudgetFileName.Data()); - } - run->AddTask(l1); - - //BEGIN finder - CbmKFParticleFinderPID* kfParticleFinderPID_TOF = - new CbmKFParticleFinderPID("fkfParticleFinderPID_TOF"); - kfParticleFinderPID_TOF->SetSIS100(); - kfParticleFinderPID_TOF->SetPIDMode(2); //0 - topology, 1 - mc, 2 - tof - run->AddTask(kfParticleFinderPID_TOF); - - CbmKFParticleFinder* kfParticleFinder_TOF = - new CbmKFParticleFinder("fCbmKFParticleFinder_TOF"); - kfParticleFinder_TOF->SetPIDInformation(kfParticleFinderPID_TOF); - kfParticleFinder_TOF->AddDecayToReconstructionList(3122); - kfParticleFinder_TOF->AddDecayToReconstructionList(-3122); - kfParticleFinder_TOF->AddDecayToReconstructionList(310); - run->AddTask(kfParticleFinder_TOF); - - CbmKFParticleFinderPID* kfParticleFinderPID_MC = - new CbmKFParticleFinderPID("fkfParticleFinderPID_MC"); - kfParticleFinderPID_MC->SetSIS100(); - kfParticleFinderPID_MC->SetPIDMode(1); //0 - topology, 1 - mc, 2 - tof - run->AddTask(kfParticleFinderPID_MC); - - CbmKFParticleFinder* kfParticleFinder_MC = - new CbmKFParticleFinder("fCbmKFParticleFinder_MC"); - kfParticleFinder_MC->SetPIDInformation(kfParticleFinderPID_MC); - kfParticleFinder_MC->AddDecayToReconstructionList(3122); - kfParticleFinder_MC->AddDecayToReconstructionList(-3122); - kfParticleFinder_MC->AddDecayToReconstructionList(310); - run->AddTask(kfParticleFinder_MC); - - // ----- KF Particle Finder QA -------------------------------------------- - CbmKFParticleFinderQA* kfParticleFinderQA = - new CbmKFParticleFinderQA("CbmKFParticleFinderQA", - 0, - kfParticleFinder_MC->GetTopoReconstructor(), - KFqaFile.Data()); - kfParticleFinderQA->SetPrintEffFrequency(100); //nEvents); - // kfParticleFinderQA->SetSuperEventAnalysis(); // SuperEvent - kfParticleFinderQA->SetEffFileName(KFeffFile.Data()); - run->AddTask(kfParticleFinderQA); - - //END finder - cout << "KF done" << endl; - - // ----- KF Particle Finder QA -------------------------------------------- - DataTreeCbmInterface* fInterface = new DataTreeCbmInterface(); - fInterface->LoadGeo(geoFile); - - fInterface->SetKFParticleFinderTOF(kfParticleFinder_TOF); - fInterface->SetKFParticleFinderMC(kfParticleFinder_MC); - fInterface->SetOutputFile(outFile); - - run->AddTask(fInterface); - cout << "DataTreeCbmInterface set" << endl; - // ------------------------------------------------------------------------ - - // ----- KF Track QA -------------------------------------------- - CbmKFTrackQA* kfTrackQA = new CbmKFTrackQA(); - run->AddTask(kfTrackQA); - // ------------------------------------------------------------------------ - - // ----- Parameter database -------------------------------------------- - FairRuntimeDb* rtdb = run->GetRuntimeDb(); - FairParRootFileIo* parIo1 = new FairParRootFileIo(); - FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); - parIo1->open(parFile.Data()); - parIo2->open(parFileList, "in"); - rtdb->setFirstInput(parIo1); - rtdb->setSecondInput(parIo2); - rtdb->setOutput(parIo1); - rtdb->saveOutput(); - // ------------------------------------------------------------------------ - - // ----- Intialise and run -------------------------------------------- - run->Init(); - - cout << "Starting run" << endl; - run->Run(0, nEvents); - // ------------------------------------------------------------------------ - - timer.Stop(); - Double_t rtime = timer.RealTime(); - Double_t ctime = timer.CpuTime(); - cout << "Macro finished succesfully." << endl; - cout << "Output file is " << outFile << endl; - cout << "Parameter file is " << parFile << endl; - printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime); - - // ----- CTest resource monitoring ------------------------------------ - FairSystemInfo sysInfo; - Float_t maxMemory = sysInfo.GetMaxMemory(); - std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; - std::cout << maxMemory; - std::cout << "</DartMeasurement>" << std::endl; - std::cout << "<DartMeasurement name=\"WallTime\" type=\"numeric/double\">"; - std::cout << rtime; - std::cout << "</DartMeasurement>" << std::endl; - Float_t cpuUsage = ctime / rtime; - std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; - std::cout << cpuUsage; - std::cout << "</DartMeasurement>" << std::endl; - // ------------------------------------------------------------------------ - - - // ----- Finish ------------------------------------------------------- - std::cout << " Test passed" << std::endl; - std::cout << " All ok " << std::endl; - RemoveGeoManager(); - // ------------------------------------------------------------------------ -} diff --git a/external/.gitignore b/external/.gitignore index 3fc963cf47..b33bb370cd 100644 --- a/external/.gitignore +++ b/external/.gitignore @@ -1,7 +1,5 @@ -DataTree AnalysisTree AnalysisTreeQA -DataTreeQA KFParticle NicaFemto Vc diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 194b932880..ab6795b23b 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -32,8 +32,6 @@ if(DOWNLOAD_EXTERNALS) Include(InstallVC.cmake) Include(InstallKFParticle.cmake) - Include(InstallDataTree.cmake) - Include(InstallDataTreeQA.cmake) Include(InstallNicaFemto.cmake) Include(InstallAnalysisTree.cmake) # Include(InstallAnalysisTreeQA.cmake) @@ -44,7 +42,6 @@ if(DOWNLOAD_EXTERNALS) else() # Define targets which are needed by CbmRoot but are not available # whithout the external packages - add_library(DATATREE SHARED IMPORTED GLOBAL) add_library(ANALYSISTREE SHARED IMPORTED GLOBAL) add_library(NICAFEMTO SHARED IMPORTED GLOBAL) add_library(KFPARTICLE SHARED IMPORTED GLOBAL) diff --git a/external/InstallDataTree.cmake b/external/InstallDataTree.cmake deleted file mode 100644 index 6884af7773..0000000000 --- a/external/InstallDataTree.cmake +++ /dev/null @@ -1,52 +0,0 @@ -set(DATATREE_VERSION f9b31d3d3362f5a98665d8d192440fba98181f31) -#set(DATATREE_VERSION a99224d7e9fd20b7a7e3b203cfe2778af8632ecb) - -set(DATATREE_SRC_URL "https://git.cbm.gsi.de/pwg-c2f/DataTree.git") -set(DATATREE_DESTDIR "${CMAKE_BINARY_DIR}/external/DATATREE-prefix") -set(DATATREE_LIBNAME "${CMAKE_SHARED_LIBRARY_PREFIX}DataTree${CMAKE_SHARED_LIBRARY_SUFFIX}") - -download_project_if_needed(PROJECT DataTree_source - GIT_REPOSITORY ${DATATREE_SRC_URL} - GIT_TAG ${DATATREE_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DataTree - TEST_FILE CMakeLists.txt - ) - -If(ProjectUpdated) - File(REMOVE_RECURSE ${DATATREE_DESTDIR}) - Message("DataTree source directory was changed so build directory was deleted") -EndIf() - -ExternalProject_Add(DATATREE - BUILD_IN_SOURCE 0 - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DataTree - BUILD_BYPRODUCTS ${DATATREE_LIBRARY} - LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 - CMAKE_ARGS -G ${CMAKE_GENERATOR} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} - -DFIXTARGET=TRUE - -DROOTSYS=${SIMPATH} - -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON - -DEXPERIMENT=CBM - INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install -) - -add_library(DataTree SHARED IMPORTED) -set_target_properties(DataTree PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib) -add_dependencies(DataTree DATATREE) - -set(DataTree_LIB_DIR ${CMAKE_BINARY_DIR}/lib) -set(DataTree_LIBRARIES DataTree) -set(DataTree_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") -set(DataTree_FOUND TRUE) - -Install(FILES ${CMAKE_BINARY_DIR}/lib/${DATATREE_LIBNAME} - ${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}DataTree.rootmap - ${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}DataTree_rdict.pcm - DESTINATION lib - ) diff --git a/external/InstallDataTreeQA.cmake b/external/InstallDataTreeQA.cmake deleted file mode 100644 index 261ce0579d..0000000000 --- a/external/InstallDataTreeQA.cmake +++ /dev/null @@ -1,52 +0,0 @@ -set(DATATREEQA_VERSION e549c95c1489012a3fa2c5d0c8908478babd08b7) # hash is tag 1.0. Needed for test -set(DATATREEQA_SRC_URL "https://git.cbm.gsi.de/pwg-c2f/DataTreeQA.git") -set(DATATREEQA_DESTDIR "${CMAKE_BINARY_DIR}/external/DATATREEQA-prefix") -set(DATATREEQA_LIBNAME "${CMAKE_SHARED_LIBRARY_PREFIX}DataTreeQA${CMAKE_SHARED_LIBRARY_SUFFIX}") - - -download_project_if_needed(PROJECT DataTreeQA_source - GIT_REPOSITORY ${DATATREEQA_SRC_URL} - GIT_TAG ${DATATREEQA_VERSION} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DataTreeQA - TEST_FILE CMakeLists.txt - ) - -If(ProjectUpdated) - File(REMOVE_RECURSE ${DATATREEQA_DESTDIR}) - Message("DataTreeQA source directory was changed so build directory was deleted") -EndIf() - -ExternalProject_Add(DATATREEQA - DEPENDS DataTree - BUILD_IN_SOURCE 0 - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DataTreeQA - BUILD_BYPRODUCTS ${DATATREEQA_LIBRARY} - LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 - CMAKE_ARGS -G ${CMAKE_GENERATOR} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} - -DFIXTARGET=TRUE - -DROOTSYS=${SIMPATH} - -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON - -DEXPERIMENT=CBM - INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install -) - -add_library(DataTreeQA SHARED IMPORTED) -set_target_properties(DataTreeQA PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib) -add_dependencies(DataTreeQA DATATREE) - -set(DataTreeQA_LIB_DIR ${CMAKE_BINARY_DIR}/lib) -set(DataTreeQA_LIBRARIES DataTreeQA) -set(DataTreeQA_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include") -set(DataTreeQA_FOUND TRUE) - -Install(FILES ${CMAKE_BINARY_DIR}/lib/${DATATREEQA_LIBNAME} - ${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}DataTreeQA.rootmap - ${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}DataTreeQA_rdict.pcm - DESTINATION lib - ) diff --git a/macro/C2F/CMakeLists.txt b/macro/C2F/CMakeLists.txt index afc72532a8..d5e3792188 100644 --- a/macro/C2F/CMakeLists.txt +++ b/macro/C2F/CMakeLists.txt @@ -3,11 +3,8 @@ Set(MACRO_DIR ${CBMROOT_BINARY_DIR}/macro/C2F) GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/C2F/c2f_transport.C) GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_digi.C ${MACRO_DIR}) GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/run/run_reco_event.C ${MACRO_DIR}) -GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/analysis/PWGC2F/flow/DataTreeCbmInterface/macro/run_treemaker.C ${MACRO_DIR}) GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/analysis/common/analysis_tree_converter/run_analysis_tree_maker.C ${MACRO_DIR}) GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/analysis/common/at_kfpf_interface/run_at_kfpf.C ${MACRO_DIR}) -GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/external/DataTreeQA/macro/PopulateQAConfigurations.C ${MACRO_DIR}) -GENERATE_CBM_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/external/DataTreeQA/macro/RunDataTreeQA.C ${MACRO_DIR}) # Put the .rootrc file into the directory from which root is executed. # Otherwise the rootalias file is not loaded @@ -55,15 +52,6 @@ If( ($ENV{ctest_model} MATCHES Nightly) OR ($ENV{ctest_model} MATCHES Weekly) ) Set(fixture_c2f_ana fixture_c2f_ana_${testname}) set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP ${fixture_c2f_ana}) - # --- DataTree - Set(testname c2f_treemaker_${setup}) - Add_Test(${testname} ${MACRO_DIR}/run_treemaker.sh ${NumEvents} \"data/${setup}_test\" \"${setup}\") - Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "300") - Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") - set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_c2f_ana}) - Set(fixture_c2f_datatree fixture_c2f_datatree_${testname}) - set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP ${fixture_c2f_datatree}) - # --- AnalysisTree Set(testname analysis_tree_maker_${setup}) Add_Test(${testname} ${MACRO_DIR}/run_analysis_tree_maker.sh ${NumEvents} \"data/${setup}_test\" \"${setup}\") @@ -82,20 +70,6 @@ If( ($ENV{ctest_model} MATCHES Nightly) OR ($ENV{ctest_model} MATCHES Weekly) ) Set(fixture_c2f_at_kfpf_interface fixture_c2f_at_kfpf_interface_${testname}) set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP ${fixture_c2f_at_kfpf_interface}) - # --- DataTreeQA input - Set(testname c2f_datatreeqa_input_${setup}) - Add_Test(${testname} ${MACRO_DIR}/PopulateQAConfigurations.sh) - Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "10") - set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_c2f_datatree}) - Set(fixture_c2f_datatreeqa_input fixture_c2f_datatreeqa_input_${testname}) - set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP ${fixture_c2f_datatreeqa_input}) - - # --- DataTreeQA - Set(testname c2f_datatreeqa_${setup}) - Add_Test(${testname} ${MACRO_DIR}/RunDataTreeQA.sh \"${setup}.tree.list\" \"\" \"data/${setup}_test.qa.root\" \"QAConfigurations.root\" \"cbm_12agev_config\" ) - Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "30") - set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_c2f_datatreeqa_input}) - EndForEach(setup IN LISTS cbm_setup) # end of test CBM setups from geometry/setup EndIf() -- GitLab