diff --git a/core/data/CMakeLists.txt b/core/data/CMakeLists.txt index 9eaf4743e0b3a9b9fec6d554c469480da54aac2b..95559844905f38d49b4a9dc395aa302e8afe1431 100644 --- a/core/data/CMakeLists.txt +++ b/core/data/CMakeLists.txt @@ -97,7 +97,7 @@ set(SRCS tof/CbmTofDetectorId_v07a.cxx tof/CbmTofDetectorId_v12b.cxx tof/CbmTofDetectorId_v14a.cxx - tof/CbmTofDetectorId_v20a.cxx + tof/CbmTofDetectorId_v21a.cxx tof/CbmTofAddress.cxx tof/CbmTofDigi.cxx tof/CbmTofTracklet.cxx diff --git a/core/data/tof/CbmTofDetectorId_v20a.cxx b/core/data/tof/CbmTofDetectorId_v21a.cxx similarity index 70% rename from core/data/tof/CbmTofDetectorId_v20a.cxx rename to core/data/tof/CbmTofDetectorId_v21a.cxx index 5fe62acade761b9cabeacfb9a318254cd50c118a..349b8c7095c3862912e238c347dba25d7ec286dc 100644 --- a/core/data/tof/CbmTofDetectorId_v20a.cxx +++ b/core/data/tof/CbmTofDetectorId_v21a.cxx @@ -4,13 +4,13 @@ // ------------------------------------------------------------------------- -#include "CbmTofDetectorId_v20a.h" +#include "CbmTofDetectorId_v21a.h" -const Int_t CbmTofDetectorId_v20a::shiftarray[] = {0,4,11,15,21,22,28 }; -const Int_t CbmTofDetectorId_v20a::bitarray[] = {4,7, 4, 6, 1, 6, 4}; +const Int_t CbmTofDetectorId_v21a::shiftarray[] = {0,4,11,15,21,22,28 }; +const Int_t CbmTofDetectorId_v21a::bitarray[] = {4,7, 4, 6, 1, 6, 4}; -CbmTofDetectorId_v20a::CbmTofDetectorId_v20a() +CbmTofDetectorId_v21a::CbmTofDetectorId_v21a() : CbmTofDetectorId(), result_array(), maskarray(), @@ -30,7 +30,7 @@ CbmTofDetectorId_v20a::CbmTofDetectorId_v20a() ); } -CbmTofDetectorInfo CbmTofDetectorId_v20a::GetDetectorInfo(const Int_t detectorId) +CbmTofDetectorInfo CbmTofDetectorId_v21a::GetDetectorInfo(const Int_t detectorId) { for (Int_t i=0; i < array_length; i++) { result_array[i] = (( detectorId >> shiftarray[i] ) & maskarray[i] ); @@ -41,82 +41,82 @@ CbmTofDetectorInfo CbmTofDetectorId_v20a::GetDetectorInfo(const Int_t detectorId } -Int_t CbmTofDetectorId_v20a::GetSystemId(Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetSystemId(Int_t detectorId) { return (detectorId & maskarray[0]); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a::GetSMType(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetSMType(const Int_t detectorId) { return (( detectorId >> shiftarray[2] ) & maskarray[2] ); } -Int_t CbmTofDetectorId_v20a::GetModuleType(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetModuleType(const Int_t detectorId) { return GetSMType(detectorId); } -Int_t CbmTofDetectorId_v20a::GetCounterType(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetCounterType(const Int_t detectorId) { return GetCounterType(detectorId); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a::GetSModule(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetSModule(const Int_t detectorId) { return (( detectorId >> shiftarray[1] ) & maskarray[1] ); } -Int_t CbmTofDetectorId_v20a::GetModuleId(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetModuleId(const Int_t detectorId) { return GetSModule(detectorId); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a::GetCounter(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetCounter(const Int_t detectorId) { return (( detectorId >> shiftarray[3] ) & maskarray[3] ); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a::GetSide(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetSide(const Int_t detectorId) { return (( detectorId >> shiftarray[4] ) & maskarray[4] ); } -Int_t CbmTofDetectorId_v20a::GetGap(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetGap(const Int_t detectorId) { return GetSide(detectorId); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a::GetCell(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetCell(const Int_t detectorId) { return (( detectorId >> shiftarray[5] ) & maskarray[5] ); } -Int_t CbmTofDetectorId_v20a::GetStrip(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetStrip(const Int_t detectorId) { return GetCell(detectorId); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a::GetRegion(const Int_t /*detectorId*/) +Int_t CbmTofDetectorId_v21a::GetRegion(const Int_t /*detectorId*/) { return -1; } -Int_t CbmTofDetectorId_v20a::GetCellId(const Int_t detectorId) +Int_t CbmTofDetectorId_v21a::GetCellId(const Int_t detectorId) { return (detectorId & modulemask); } //----------------------------------------------------------- -Int_t CbmTofDetectorId_v20a ::SetDetectorInfo(const CbmTofDetectorInfo detInfo) +Int_t CbmTofDetectorId_v21a ::SetDetectorInfo(const CbmTofDetectorInfo detInfo) { return ( (((detInfo.fDetectorSystem) & maskarray[0]) << shiftarray[0]) | (((detInfo.fSMtype) & maskarray[2]) << shiftarray[2]) | diff --git a/core/data/tof/CbmTofDetectorId_v20a.h b/core/data/tof/CbmTofDetectorId_v21a.h similarity index 94% rename from core/data/tof/CbmTofDetectorId_v20a.h rename to core/data/tof/CbmTofDetectorId_v21a.h index 3887071e195b82b0fddb6907ffe0da150adf6c9e..eff9be62b04da915f68e53ecaeb8679767086c01 100644 --- a/core/data/tof/CbmTofDetectorId_v20a.h +++ b/core/data/tof/CbmTofDetectorId_v21a.h @@ -6,7 +6,7 @@ /** CbmTofDetectorId.h ** Defines unique detector identifier for all TOF modules. - ** This class is the implementation for tof geometry version v20a + ** This class is the implementation for tof geometry version v21a ** nh, 11.03.2014 ** PAL, 23.09.2015: make the class common to both v14 and v15 geometries ** Field 4 used as Side index (or fake Gap index in digitizer) @@ -28,21 +28,21 @@ **/ -#ifndef CBMTOFDETECTORID_V20A_H -#define CBMTOFDETECTORID_V20A_H 1 +#ifndef CBMTOFDETECTORID_V21A_H +#define CBMTOFDETECTORID_V21A_H 1 #include"CbmTofDetectorId.h" -class CbmTofDetectorId_v20a : public CbmTofDetectorId +class CbmTofDetectorId_v21a : public CbmTofDetectorId { public: /** Constructor **/ - CbmTofDetectorId_v20a(); + CbmTofDetectorId_v21a(); /** Destructor **/ - ~CbmTofDetectorId_v20a() {}; + ~CbmTofDetectorId_v21a() {}; /** Get complete system info from detector ID ** This will return a pointer to an integer diff --git a/core/detectors/tof/CbmTofGeoHandler.cxx b/core/detectors/tof/CbmTofGeoHandler.cxx index 836b1defb237634c49fdf7b913bd0486ebbcf9c6..f133d8700fb59a073465451a10bfc226075a26c3 100644 --- a/core/detectors/tof/CbmTofGeoHandler.cxx +++ b/core/detectors/tof/CbmTofGeoHandler.cxx @@ -8,6 +8,7 @@ #include "CbmTofDetectorId_v07a.h" // for CbmTofDetectorId_v07a #include "CbmTofDetectorId_v12b.h" // for CbmTofDetectorId_v12b #include "CbmTofDetectorId_v14a.h" // for CbmTofDetectorId_v14a +#include "CbmTofDetectorId_v21a.h" // for CbmTofDetectorId_v21a #include <FairLogger.h> // for Logger, LOG @@ -71,6 +72,9 @@ Int_t CbmTofGeoHandler::CheckGeometryVersion() { // including also a support structure // v14a: // test beam tof geometrie developed by Norbert Herrmann + // v20a: + // tof geometrie with MRPC and Module types developed by Norbert Herrmann + if (nullptr == gGeoManager) LOG(fatal) << "No GeoManager"; TObjArray* nodes = gGeoManager->GetTopNode()->GetNodes(); @@ -110,24 +114,31 @@ Int_t CbmTofGeoHandler::CheckGeometryVersion() { || (TString(node->GetName()).Contains("v18")) || (TString(node->GetName()).Contains("v19")) || (TString(node->GetName()).Contains("v20"))) { - LOG(info) - << "CbmTofGeoHandler::CheckGeometryVersion: Found TOF geometry " - << TString(node->GetName()) << ", treat as Id 14a "; - // if(nullptr!=fTofId) fTofId->Delete(); - fTofId = new CbmTofDetectorId_v14a(); - fGeoVersion = k14a; - - if (TString(node->GetName()).Contains("v14a_n")) { - if (fIsSimulation && 0 != fMCVersion) { - LOG(fatal) << "Using node names instead of volume names to extract " - "the module type " - << "in a MC simulation only works with GEANT3 VMC!"; + LOG(info) + << "CbmTofGeoHandler::CheckGeometryVersion: Found TOF geometry " + << TString(node->GetName()) << ", treat as Id 14a "; + // if(nullptr!=fTofId) fTofId->Delete(); + fTofId = new CbmTofDetectorId_v14a(); + fGeoVersion = k14a; + + if (TString(node->GetName()).Contains("v14a_n")) { + if (fIsSimulation && 0 != fMCVersion) { + LOG(fatal) << "Using node names instead of volume names to extract " + "the module type " + << "in a MC simulation only works with GEANT3 VMC!"; + } + + fUseNodeName = kTRUE; } - - fUseNodeName = kTRUE; - } - - return fGeoVersion; + return fGeoVersion; + } else if ((TString(node->GetName()).Contains("v21"))) { + LOG(info) + << "CbmTofGeoHandler::CheckGeometryVersion: Found TOF geometry " + << TString(node->GetName()) << ", treat as Id 21a "; + // if(nullptr!=fTofId) fTofId->Delete(); + fTofId = new CbmTofDetectorId_v21a(); + fGeoVersion = k21a; + return fGeoVersion; } else { LOG(fatal) << "Found an unknown TOF geometry."; fGeoVersion = -1; diff --git a/core/detectors/tof/CbmTofGeoHandler.h b/core/detectors/tof/CbmTofGeoHandler.h index 9d3301486562029d8fc89fa2604b1581f81084cd..84d3f8477d92cb4016dc206f820ae540ee2ce934 100644 --- a/core/detectors/tof/CbmTofGeoHandler.h +++ b/core/detectors/tof/CbmTofGeoHandler.h @@ -14,7 +14,7 @@ #ifndef CBMTOFGEOHANDLER_H #define CBMTOFGEOHANDLER_H 1 -enum TofGeometryVersions { k07a, k12a, k12b, k14a }; +enum TofGeometryVersions { k07a, k12a, k12b, k14a, k21a}; #include <Rtypes.h> // for THashConsistencyHolder, ClassDef #include <RtypesCore.h> // for Int_t, Float_t, Bool_t, kFALSE, Double_t diff --git a/reco/detectors/tof/CbmTofEventClusterizer.cxx b/reco/detectors/tof/CbmTofEventClusterizer.cxx index fe9a89fdb8e831906b00b94160813c25e50dabbe..e81e978fc31ff077d70b1a42280edca7709c2735 100644 --- a/reco/detectors/tof/CbmTofEventClusterizer.cxx +++ b/reco/detectors/tof/CbmTofEventClusterizer.cxx @@ -19,7 +19,7 @@ #include "CbmTofCreateDigiPar.h" // in tof/TofTools #include "CbmTofDetectorId_v12b.h" // in cbmdata/tof #include "CbmTofDetectorId_v14a.h" // in cbmdata/tof -#include "CbmTofDetectorId_v20a.h" // in cbmdata/tof +#include "CbmTofDetectorId_v21a.h" // in cbmdata/tof #include "CbmTofDigi.h" // in cbmdata/tof #include "CbmTofDigiBdfPar.h" // in tof/TofParam #include "CbmTofDigiPar.h" // in tof/TofParam @@ -603,7 +603,7 @@ Bool_t CbmTofEventClusterizer::InitParameters() { if (iGeoVersion == k14a) fTofId = new CbmTofDetectorId_v14a(); else - fTofId = new CbmTofDetectorId_v20a(); + fTofId = new CbmTofDetectorId_v21a(); // create digitization parameters from geometry file CbmTofCreateDigiPar* tofDigiPar =