#include "CbmTofCell.h" #include "CbmTofPoint.h" #include "CbmTofDetectorId.h" #include "FairLogger.h" #include "TGeoManager.h" #include "TMath.h" #include using std::cout; using std::endl; // ----- Default constructor ------------------------------------------- CbmTofCell::CbmTofCell() : TNamed(), fDetectorId(0), fX(-666.), fY(-666.), fZ(-666.), fSizex(-666.), fSizey(-666.) { } CbmTofCell::CbmTofCell(Int_t detId, Double_t x, Double_t y, Double_t z, Double_t sizex, Double_t sizey) : TNamed(), fDetectorId(detId), fX(x), fY(y), fZ(z), fSizex(sizex), fSizey(sizey) { } // ------------------------------------------------------------------------- CbmTofCell::~CbmTofCell() { } /* void CbmTofCell::GetPadInfo(CbmTrdPoint *trdPoint, Int_t &Col, Int_t &Row, Int_t &Sector) { // Calculate point in the middle of the detector. This is // for safety reasons, because the point at exit is slightly // outside of the active volume. If one does not use a point // in the detector one will get a wrong volume from the // geomanager. Navigate to the correct volume to get all // necessary information about this volume Double_t x_mean = (trdPoint->GetXIn()+trdPoint->GetXOut())/2.; Double_t y_mean = (trdPoint->GetYIn()+trdPoint->GetYOut())/2.; Double_t z_mean = (trdPoint->GetZIn()+trdPoint->GetZOut())/2.; gGeoManager->FindNode(x_mean, y_mean, z_mean); // Get the local point in local MC coordinates from // the geomanager. This coordinate system is rotated // if the chamber is rotated. This is corrected in // GetModuleInformation to have a // the same local coordinate system in all the chambers const Double_t *global_point = gGeoManager->GetCurrentPoint(); Double_t local_point[3]; // global_point[3]; gGeoManager->MasterToLocal(global_point, local_point); Int_t ModuleID = trdPoint->GetDetectorID(); GetModuleInformation(ModuleID, local_point, Col, Row, Sector); } */ /* void CbmTofCell::GetModuleInformation(Int_t VolumeID, Double_t *local_point, Int_t &Col, Int_t &Row, Int_t §or) { // safety check. Up to now allways correct, so could be removed. if (fDetectorId != VolumeID ){ cout<<" -E- This is wrong!!!!!!!!!!!!!!!!!!!!!"<FindNode(fX, fY, fZ); // Get the local point in local MC coordinates from // the geomanager. This coordinate system is rotated // if the chamber is rotated. This is corrected in // GetModuleInformation to have a // the same local coordinate system in all the chambers Double_t global_point[3]; // global_point[3]; gGeoManager->LocalToMaster(local_point, global_point); // calculate the position in the global coordinate system // with the origin in target Float_t posX=global_point[0]; Float_t posY=global_point[1]; Float_t posZ=global_point[2]; posHit.SetXYZ(posX, posY, posZ); padSize.SetXYZ(padsizex,padsizey, 0.); } */ void CbmTofCell::Print() { LOG(INFO)<<"ID, X, Y, Z, sizex, sizey: "<< fDetectorId << ", "<< fX << ", "<< fY << ", "<< fZ << ", "<< fSizex << ", "<< fSizey << FairLogger::endl; } // ------------------------------------------------------------------------- ClassImp(CbmTofCell)