Skip to content
Snippets Groups Projects
Commit 15489dde authored by Administrator's avatar Administrator
Browse files

Port changes of Tof digitization parameters from mcbm dev branch

Port commits 16277 and 16488 from svn development branch
parent 012348a4
No related branches found
No related tags found
1 merge request!16Port mcbm dev core
...@@ -132,6 +132,18 @@ InitStatus CbmTofCreateDigiPar::Init(){ ...@@ -132,6 +132,18 @@ InitStatus CbmTofCreateDigiPar::Init(){
FillCellMapAsciiGeometry(); FillCellMapAsciiGeometry();
} }
// fill Transformation matrices for each cell
std::map<Int_t, TGeoNode*> nodemap;
for (Int_t iCell=0; iCell<fDigiPar->GetNrOfModules(); iCell++) {
Int_t iAddr=fDigiPar->GetCellId(iCell);
CbmTofCell *fChannelInfo = fDigiPar->GetCell(iAddr);
gGeoManager->FindNode(fChannelInfo->GetX(),fChannelInfo->GetY(),fChannelInfo->GetZ());
TGeoNode* tGeoNode = gGeoManager->GetCurrentNode();
nodemap.insert( std::pair<Int_t, TGeoNode*>(iAddr,tGeoNode) );
LOG(debug) << Form("Digipar for %d, addr 0x%08x: Node=%p",iCell,iAddr,tGeoNode);
}
fDigiPar->SetNodeMap(nodemap);
return kSUCCESS; return kSUCCESS;
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
...@@ -473,7 +485,8 @@ void CbmTofCreateDigiPar::FillDigiPar() ...@@ -473,7 +485,8 @@ void CbmTofCreateDigiPar::FillDigiPar()
Int_t Nrcells = (Int_t)fCellMap.size(); Int_t Nrcells = (Int_t)fCellMap.size();
LOG(debug) <<"FillDigiPar:: Nr. of tof cells: "<<Nrcells; LOG(debug) <<"FillDigiPar:: Nr. of tof cells: "<<Nrcells;
SetParContainers();
if (NULL == fDigiPar) LOG(fatal) << "Tof Digi Parameter container not available ";
fDigiPar->SetNrOfCells(Nrcells); //transfer info to DigiPar fDigiPar->SetNrOfCells(Nrcells); //transfer info to DigiPar
TArrayI *CellId = new TArrayI(Nrcells); TArrayI *CellId = new TArrayI(Nrcells);
......
...@@ -100,3 +100,4 @@ Bool_t CbmTofDigiPar::getParams(FairParamList* l) ...@@ -100,3 +100,4 @@ Bool_t CbmTofDigiPar::getParams(FairParamList* l)
} }
return kTRUE; return kTRUE;
} }
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <map> // for map #include <map> // for map
#include <FairParGenericSet.h> // for FairParGenericSet #include <FairParGenericSet.h> // for FairParGenericSet
#include <TGeoManager.h>
#include <TNode.h>
class CbmTofCell; class CbmTofCell;
class FairParamList; class FairParamList;
...@@ -45,8 +47,12 @@ class CbmTofDigiPar : public FairParGenericSet ...@@ -45,8 +47,12 @@ class CbmTofDigiPar : public FairParGenericSet
Int_t GetCellId(Int_t i) {return fCellIdArray[i];} Int_t GetCellId(Int_t i) {return fCellIdArray[i];}
CbmTofCell* GetCell(Int_t i) {return fCellMap[i];} CbmTofCell* GetCell(Int_t i) {return fCellMap[i];}
TGeoNode* GetNode(Int_t iCell) {return fCellNode[iCell];}
void SetNode(Int_t iCell, TGeoNode* tGeoNode) { fCellNode.insert( std::pair<Int_t, TGeoNode*>(iCell,tGeoNode) ); }
void SetNodeMap(std::map<Int_t, TGeoNode*> map) { fCellNode=map; }
private: private:
/** Map of Unique Tof Cell Id to corresponding TofCell **/ /** Map of Unique Tof Cell Id to corresponding TofCell **/
...@@ -59,8 +65,9 @@ class CbmTofDigiPar : public FairParGenericSet ...@@ -59,8 +65,9 @@ class CbmTofDigiPar : public FairParGenericSet
TArrayD fCellDxArray; // Array to hold the unique IDs for all cells TArrayD fCellDxArray; // Array to hold the unique IDs for all cells
TArrayD fCellDyArray; // Array to hold the unique IDs for all cells TArrayD fCellDyArray; // Array to hold the unique IDs for all cells
Int_t fNrOfCells; // Total number of cells Int_t fNrOfCells; // Total number of cells
std::map<Int_t, TGeoNode*> fCellNode;
ClassDef(CbmTofDigiPar,2)
ClassDef(CbmTofDigiPar,3)
}; };
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment