// ------------------------------------------------------------------------- // ----- CbmVisStripHit source file ----- // ----- Created 14/03/07 by E. Kryshen ----- // ------------------------------------------------------------------------- #include "CbmVisStripHit.h" #include "CbmStripHit.h" #include "CbmMCTrack.h" #include "CbmMuchGeoScheme.h" #include "CbmMuchModule.h" // ------------------------------------------------------------------------- CbmVisStripHit::CbmVisStripHit(CbmStripHit* hit):CbmVisHit(),TLine(){ fHit = hit; CbmMuchGeoScheme* fGeoScheme = CbmMuchGeoScheme::Instance(); if (!fGeoScheme) { Fatal("CbmVisStripHit","CbmMuchGeoScheme not initialized"); return; } CbmMuchModule* mod = fGeoScheme->GetModuleByDetId(fHit->GetDetectorId()); Double_t x1 = mod->GetX1(); // left border of the module Double_t x2 = mod->GetX2(); // right border of the module Double_t y1 = mod->GetY1(); // bottom border of the module Double_t y2 = mod->GetY2(); // top border of the module Double_t x[2]; // X-coordinates of the module/strip crossing Double_t y[2]; // Y-coordinates of the module/strip crossing Double_t a = hit->GetPhi(); Double_t p = hit->GetU(); // Determine potential crossings Double_t yc1 = (p-x1*cos(a))/sin(a); Double_t yc2 = (p-x2*cos(a))/sin(a); Double_t xc1 = (p-y1*sin(a))/cos(a); Double_t xc2 = (p-y2*sin(a))/cos(a); Int_t i=0; // Select two crossings in the module range if (i<2 && yc1>y1 && yc1y1 && yc2x1 && xc1x1 && xc2